Created
February 17, 2012 17:44
-
-
Save nateabele/1854561 to your computer and use it in GitHub Desktop.
An example of how to completely reconfigure Lithium's templating engine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use lithium\net\http\Media; | |
/** | |
* This re-maps your template paths so you can have stuff like `pages/users_{username}.php` | |
* instead of the Lithium default. | |
*/ | |
Media::type('html', 'text/html', array( | |
'view' => 'lithium\template\View', | |
'processes' => array( | |
'all' => array('template'), | |
'fragment' => array('fragment') | |
), | |
'steps' => array( | |
'fragment' => array('path' => 'fragment') | |
), | |
'paths' => array( | |
'template' => LITHIUM_APP_PATH . '/views/pages/{:page}.php', | |
'fragment' => LITHIUM_APP_PATH . '/views/fragments/{:template}.inc' | |
) | |
)); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment