Archive for July 6th, 2009
Symfony Template and Component Templates
Posted by PhazeonPhoenix in Symfony on July 6th, 2009
Today I’ve got a pair of small templates.
The first is a comment header for the Symfony template files. Due to the shear number of these template files you can create if you’re partial and component happy, sometimes just the filename isn’t enough to really describe what file your editing. My motto is you can never have too much documentation.
1 2 3 4 5 6 7 8 9 10 11 | <?php /** * Template Template * * @author Phazeon Phoenix <phoenix@phazeon.com> * @version 1 * @package Templates * @copyright 2009 Phazeon.com */ ?> <h2>My Template</h2> |
Next is a template for new components. This is the sort of thing that I always had trouble remembering. I had to track down the exact syntax for the component class declaration each time. Now in my IDE (phpDesigner) I can define user entered variables in my snippets/templates. It prompts me for the model name and the method name minus the “execute” prefix.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <?php /** * Component Template * * @author Phazeon Phoenix <phoenix@phazeon.com> * @version 1 * @package Components * @copyright 2009 Phazeon.com */ class templateComponents extends sfComponents { public function executeSomething() { } } |
