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
1 2 3 4 5 6 7 8 9 10 11 12 | 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)); }); |
Leave A Comment