简体   繁体   English

CakePhp:关于视图

[英]CakePhp: About Views

What is the difference between to these in cake php? 这些蛋糕php有什么区别?

$this->fetch('title'); 




$this->extend('/Common/view');

$this->element('shop/cart.ctp');

You can learn lots from this online book/page: 您可以从这个在线书籍/页面中学到很多东西:

http://book.cakephp.org/2.0/en/views.html http://book.cakephp.org/2.0/en/views.html

  1. View Templates 查看模板
  2. Extending Views 扩展视图
    1. Using view blocks 使用视图块
    2. Displaying blocks 显示块
    3. Using blocks for script and CSS files 使用块来处理脚本和CSS文件
  3. Layouts 布局
    1. Using layouts from plugins 使用插件的布局
  4. Elements 分子
    1. Passing Variables into an Element 将变量传递给元素
    2. Caching Elements 缓存元素
  5. Requesting Elements from a Plugin 从插件中请求元素
  6. Creating your own view classes 创建自己的视图类
  7. View API 查看API

Hope it will help you! 希望它能帮到你!

  • fetch() is used mainly in layout file to output a block of content. fetch()主要用于布局文件中以输出内容块。
  • extend() is used to extend view. extend()用于扩展视图。 which allows you to wrap one view in another. 它允许您将一个视图包装在另一个视图中。
  • element() is used to group an reusable piece of view. element()用于对可重用的视图进行分组。

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

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