简体   繁体   English

Lithium PHP:没有布局的打开视图

[英]Lithium PHP: Open view without layout

I am using the PHP framework Lithium (aka li3). 我正在使用PHP框架Lithium(又名li3)。 I want to be able to open just a view (ie without a layout) in a jquery dialog box. 我希望能够在jquery对话框中打开一个视图 (即没有布局)。 Ideally, I would like this to be done with a small modification to the URL, for example: 理想情况下,我希望通过对URL的一个小修改来完成此操作,例如:

Normal path to action: http://localhost/controller/action/ 

View only path to action: http://localhost/controller/action/view_only/

This obviously still has to work with normal URL parameters and GET requests. 这显然仍然需要使用普通的URL参数和GET请求。 Additionally, I would love not to have to change any existing controllers. 此外,我希望不必更改任何现有的控制器。

Does anybody know how I could achieve this? 有谁知道我怎么能做到这一点?

Thanks, Max. 谢谢,马克斯。

// In the controller:

if ($someCondition) {
    $this->_render['layout'] = false;
}
// ...where $someCondition is based on whatever URL modification you do

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM