Use constants for template managing

Submitted by The Saint Genius - 3 years ago

If you are using the same template in a lot of places and might later need an easy way to switch out the template for a different one without having to go through all views that implement it or replacing the current template, then consider using a constant to pass this parameter. Doing this will allow you to switch out your template for any other template at any time in nearly no time at all.

Add to the bottom of your /app/start/global.php:
    
    define('SITE_TEMPLATE', 'templates.main')
    
In the view files that extend 'templates.main':
    
    @extend(SITE_TEMPLATE)
    
comments powered by Disqus