Skip to content

Instantly share code, notes, and snippets.

@rapzo
Forked from nateabele/media.php
Created March 19, 2012 19:13
Show Gist options
  • Save rapzo/2124746 to your computer and use it in GitHub Desktop.
Save rapzo/2124746 to your computer and use it in GitHub Desktop.
An example of how to completely reconfigure Lithium's templating engine
<?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