Most of the time, a web application will have some parts which are pretty constant no matter what you are viewing or editing. How to render these parts are not directly obvious since most of the CakePHP tutorials focus on developing the MVC parts of the application. After much code digging in some CakePHP applications, I've concluded that it is done using the renderElement function. You'll use it something like this in your app/views/layouts/default.ctp:
<?php $this->renderElement('mainmenu'); ?>
And then you'll have to create the file mainmenu .ctp in the app/views/elements directory. Piece of CakePHP eh.. ;)
This blog is about the PHP solutions I have to think of when I'm developing systems almost every single day...
Wednesday, January 30, 2008
Rendering page elements in CakePHP
Subscribe to:
Post Comments (Atom)
Labels
- cakephp (27)
- HABTM (3)
- behavior (3)
- database (3)
- cache (2)
- component (2)
- query (2)
- Auth (1)
- acl (1)
- ajax (1)
- bake (1)
- bug (1)
- cakephp login (1)
- check boxes (1)
- code igniter (1)
- conditions (1)
- core (1)
- datepicker (1)
- find (1)
- framework (1)
- internationalization (1)
- joomla (1)
- link (1)
- model bindings (1)
- mysql function (1)
- php (1)
- recursive (1)
- redirects problem (1)
- resources (1)
- routing (1)
- shell (1)
- smarty (1)
- soft delete (1)
- template engine (1)
Blog Archive
-
▼
2008
(33)
-
►
February
(16)
- Finally got the behaviour working
- Warning!!! The error is cached
- CakePHP $html->link Variables
- What will you find?
- Fixup for the attach to anything plugin for cakeph...
- A soft delete behaviour
- Internationalization with CakePHP
- Output helper javascript into headers properly
- Ajax with Cakephp resources
- Login redirect causing problems
- Bindable behaviours
- HABTM Add & Delete Advanced Behaviour
- Using the Coolest DHTML/Javascript Calendar in Cak...
- Finally a working login in CakePHP
- Create a login in CakePHP
- Update on rendering element in CakePHP
-
►
February
(16)

0 comments:
Post a Comment