开发者

Plugin controller actions

开发者 https://www.devze.com 2023-03-30 01:24 出处:网络
I am working on a plugin and I am having a small issue with adding actions to the plugins main controller.

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'));

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号