Cakephp 2.6 进入插件后如何return到主应用
Cakephp 2.6 how do I return to the main application after entering a plugin
我正在使用 Luis Dias 的报告管理器插件为我正在开发的应用程序生成一些快速报告。在我的应用程序仪表板中,我使用以下命令输入插件:
<td style="text-align:center">
<button style="height:75px; width:175px; background-color:BurlyWood; font-size:20px; font-family:Verdana"
onclick="window.location.href='<?php echo Router::url(array('controller'=>'report_manager'
,'action'=>'reports'))?>'">Report Management</button>
我真的很想在新的 window 中打开报告生成器向导,但这是一个不同的问题..
完成报告生成器后,我想 return 到我的应用程序中的仪表板。但是,我现在在插件的域中,无法找到 "route" 我返回调用应用程序的命令。
提前致谢
麦克
To 'escape' 从插件路由时,你需要在路由数组中传递 plugin => false
。例如:-
$this->Html->url([
'controller' => 'pages',
'action' => 'view',
1,
'plugin' => false
]);
如果您不传递 plugin
属性,它会假定您希望保留在当前插件的上下文中。在使用插件的地方使用链接时,您需要小心这一点。
我正在使用 Luis Dias 的报告管理器插件为我正在开发的应用程序生成一些快速报告。在我的应用程序仪表板中,我使用以下命令输入插件:
<td style="text-align:center">
<button style="height:75px; width:175px; background-color:BurlyWood; font-size:20px; font-family:Verdana"
onclick="window.location.href='<?php echo Router::url(array('controller'=>'report_manager'
,'action'=>'reports'))?>'">Report Management</button>
我真的很想在新的 window 中打开报告生成器向导,但这是一个不同的问题..
完成报告生成器后,我想 return 到我的应用程序中的仪表板。但是,我现在在插件的域中,无法找到 "route" 我返回调用应用程序的命令。
提前致谢
麦克
To 'escape' 从插件路由时,你需要在路由数组中传递 plugin => false
。例如:-
$this->Html->url([
'controller' => 'pages',
'action' => 'view',
1,
'plugin' => false
]);
如果您不传递 plugin
属性,它会假定您希望保留在当前插件的上下文中。在使用插件的地方使用链接时,您需要小心这一点。