我正在尝试使用CakePHP框架在插件中创建插件。
I am attemping to create a Plugin inside a Plugin using the CakePHP Framework.
我的文件夹结构是这样的
My folder structure is like so
app/Plugin/SbnAdmin/Plugin/SbnChart/.....我正在使用以下行来加载SbnAdmin插件
I am using the following line to load the SbnAdmin plugin
CakePlugin::loadAll(array('SbnAdmin' => array('bootstrap' => true)));在SbnAdmin引导程序中,我有
And in the SbnAdmin bootstrap I have
CakePlugin::loadAll();我能够从SbnAdmin插件查看控制器/模型/视图,但是我无法访问SbnChart插件...
I am able to view a controller/model/view from the SbnAdmin plugin, but I am unable to access the SbnChart plugin...
我尝试过
www..../sbn_admin/sbn_chart/chart/index www..../sbn_chart/chart/index没有成功,我不确定还能做什么,还有什么想法吗?
With no success and I am not sure what else I can do, Any ideas?
推荐答案在您的SbnAdmin引导程序添加:
In your SbnAdmin bootstrap add:
App::build(array('Plugin' => array(CakePlugin::path('SbnAdmin') . 'Plugin' . DS))); CakePlugin::load('SbnChart');我们正在做的是告诉cake添加其他路径来寻找加载插件的方式,这种情况在您的SbnAdmin / Plugin文件夹中。然后我们将随后加载该插件。
What we're doing is telling cake to add additional paths to look for to load the plugins, in this case inside your SbnAdmin/Plugin folder. Then we are loading the plugin afterwards.
您现在应该可以通过常规的 / plugin_name / controller / action 或您的情况 / sbn_chart / controller / action
You should be able to access it now via the normal /plugin_name/controller/action or in your case /sbn_chart/controller/action
更多推荐
是否可以在CakePHP的插件内部创建插件?
发布评论