Skip to content

Instantly share code, notes, and snippets.

@nateabele
Created February 17, 2012 17:44
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save nateabele/1854561 to your computer and use it in GitHub Desktop.
Save nateabele/1854561 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