Closed harikt closed 9 years ago
Hi,
I think it is good to show how to inject a Twig view rather than calling $this['view'] inside controller / anonymous function.
$this['view']
$app->get('/hello/{name}', function ($request, $response, $args) { $this['view']->render('profile.html', [ 'name' => $args['name'] ]); })->setName('profile');
The idea is even if we are using a different framework, we can make use of the code without changes.
Hi,
I think it is good to show how to inject a Twig view rather than calling
$this['view']
inside controller / anonymous function.The idea is even if we are using a different framework, we can make use of the code without changes.