Elements in CakePHP
CakePHP February 12th, 2007Elements are small blocks of code that can be reused in different pages of a layout.
Elements need to be uploaded in /app/views/elements/ directory and have the .thtml extension.
By default elements haven't acces to any data, if you want to give it access to any data you have to send it as a parameter in an array.
Example without parameters:
PHP:
Example of calling an element with parameters:
PHP:
This pieces of code need to be inserted in your view.
October 2nd, 2007 at 9:29 pm
Nice copy and paste work!
Thanks for this one…
March 17th, 2008 at 10:31 pm
Just wanted to say Hello to everyone.
Much to read and learn here, I’m sure I will enjoy !