在cakephp中创建具有多个视图的页面 [英] creating a page with multiple views in cakephp

查看:192
本文介绍了在cakephp中创建具有多个视图的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

确定,我是新来的CakePhp。我以前没有使用过任何框架,这是我第一次。
我的问题是如何在一个页面上放置多个视图。
例如在一个典型的主页上,我会有newsfeed,以及登录,聊天框等形式。
我理解的是每个人都有不同的控制器和视图。
因此,如何将它们放在一起?
感谢。

ok, I am new to CakePhp. I haven't used any framework before and this is my first time. The question that I have is how to put multiple views on a single page. For example on a typical homepage, I will have newsfeed, as well as form for login, chatbox etc. What i understand is each of them will have different controller and views. Therefore how do I put them together ? Thanks.

推荐答案

有两种方法可以重用视图。最好是使用元素。请查看:

There are two ways you can reuse views. The best is to use elements. Take a look at:

http:/ /book.cakephp.org/view/1081/Elements

第二种使用requestAction的方法。请查看:
http://bakery.cakephp.org/articles/gwoo/2007/04/12/creating-reusable-elements-with-requestaction

The second way to use requestAction. Take a look at: http://bakery.cakephp.org/articles/gwoo/2007/04/12/creating-reusable-elements-with-requestaction

这篇关于在cakephp中创建具有多个视图的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆