fuzzy dunlop
fuzzy dunlop

Reputation: 477

How to view a cakephp plugin page

I'm making a plugin called "test", as an example.

Is it possible to create "pages" for this plugin and display them?

In my plugin folder I've got a folder called View, and inside that another folder called Pages, which contains a file: "demo5.ctp"

+test view Pages demo5.ctp +webroot

I'm assuming the link I need to that page would be:

localhost/test/pages/demo5

localhost/[plugin_name]/pages/demo5

echo $this->Html->link('test',array(
                    'plugin'=>'test',
                    'action'=>'demo5',
                    'controller'=>'pages'
                    ));

But this gives me a Missing Controller Error? What have I missed or is this not possible?

Upvotes: 0

Views: 213

Answers (1)

Lukasstr
Lukasstr

Reputation: 435

As stated in the comments your code is correct, but you need a PagesController in your plugin. http://book.cakephp.org/2.0/en/plugins/how-to-create-plugins.html#plugin-views

Upvotes: 1

Related Questions