$Content_for_layout for cakephp

来源:互联网 发布:淘宝网商城孕妇装 编辑:程序博客网 时间:2024/06/11 17:53

http://ask.cakephp.org/questions/view/content_for_layout


Hi, I am new to cakephp. I start working on a project and $content_for_layout seems as MAster Page concept in dot net. I want to know how and from where $content_for_layout finds the content to be displayed.


Check this description

http://api.cakephp.org/class/view#method-ViewrenderLayout

and the source

http://api.cakephp.org/view_source/view/#line-418

Answered by burzum on 31/12/09


In short, it finds corresponding view file (which is like a template) on views/controller/action.ctp and uses variables set on action in controller i.e. $this->set('variable', 'some text'); on contrller becomes $variable on your view.

Answered by Lunks on 31/12/09


原创粉丝点击