Elements
Many applications have small blocks of presentation code that needs to be repeated from page to page, sometimes in different places in the layout. CakePHP can help you repeat parts of your website that need to be reused. These reusable parts are called Elements. Ads, help boxes, navigational controls, extra menus, login forms, and callouts are often implemented in CakePHP as elements. An element is basically a mini-view that can be included in other views, in layouts, and even within other elements. Elements can be used to make a view more readable, placing the rendering of repeating elements in its own file. They can also help you re-use content fragments in your application.
Elements live in the /app/views/elements/ folder, and have the .ctp filename extension. They are output using the element method of the view.
Простой текст<?php echo $this->element('helpbox'); ?>


Коментарии:
Добавить коментарий