View Template

SlimStarter is using Twig as template engine for rendering page template.

For detailed documentation about Twig, please refer to Twig documentation http://twig.sensiolabs.org/

Rendering View inside Controller

You can render template inside controller by calling View::display or View::render method

Route::get('/', function(){
   //output the content directly
   View::display('welcome.twig');
});

Route::get('/path', function(){
   //return the content and assign to variable
   $content = View::render('content.twig');

   //pass the rendering result to other template
   View::display('master.twig', array('content' => $content));
});