Plugin controller actions
I am working on a plugin and I am having a small issue with adding actions to the plugins main controller.
For example I have this plugin controller (one_page_app_controller), what I am attempting to do is have actions with开发者_如何转开发 in this controller. So that if I path to www.site.com/one_page/ the index action is called. At this point, I am not even sure if this is possible.
This is the controller I am currently working with. Any help with this is greatly appreciated.
<?php
class OnePageAppController extends AppController {
function index()
{
}
}
?>
By default you can access the plugin at /:plugin/:controller/:action. So you need to add the plugin name in there (or the folder name of the plugin)
Edit: you can set the default action Router::connect('/plugin_name/', array('plugin'=>'plugin_name','controller' => 'blah', 'action' => 'blah'));
精彩评论