php Themes
You can take advantage of themes, making it easy to switch the look and feel of your page quickly and easily.To use themes, specify the theme name in your controller:
class ExampleController extends AppController {
public $theme = 'Example';
}
Changed in version 2.1: Versions previous to 2.1 required setting the $this->viewClass = 'Theme'.
2.1 removes this requirement as the normal View class supports themes
You can also set or change the theme name within an action or within the
beforeFilter or beforeRender callback functions:$this->theme = 'AnotherExample';
For example, the view file for an edit action of a Posts controller would reside at /app/View/Themed/Example/Posts/edit.ctp. Layout files would reside in /app/View/Themed/Example/Layouts/.
If a view file can’t be found in the theme, CakePHP will try to locate the view file in the /app/View/ folder. This way, you can create master view files and simply override them on a case-by-case basis within your theme folder.
example download: https://github.com/Rhym/cakeStrap
No comments:
Post a Comment