Closed ikhsan017 closed 10 years ago
did you try View::render('template.twig', array('name' => 'John'));
since View::render return the rendered view, I use echo here
echo View::render('template.twig', array('name' => 'John'));
but it give the same result, no variable passed
you can clone this repo to reproduce the issue https://github.com/ikhsan017/SlimStarter
_edit_ since $app->render('template.twig', $data) works as expected
I am trying App::render('template.twig', $data) and it also workd
Hey, this is actually an upstream bug in the Twig view, I've sent a pull request with a fix https://github.com/codeguy/Slim-Views/pull/21.
Hi, I see your pull request was merged to upstream repo, but it is in develop branch.
until it merged to the master branch, I think I can go with App::render()
instead of View::display()
edit
using "slim-views" : "dev-develop"
to for a while till 0.1.2 released
Hi,
I am trying to implement twig as slim view renderer,
when I am using Slim-facade to render a view, variable is not passed to the view
template.twig
the routes.php
I am using this code to initiate Slim, slim-facades, and twig