0

I am trying to get the data($errors) from the Array I pass into my slim\twig template using

$response->withRedirect($this->router->pathFor($event->getRoute(),$errors )),

but when I do a twig {{dump()}} i get null,

However if I do "return $this->view->render($response,$event->getRoute(),$errors);" and then dump it works I get the data i need.

I am wondering how to do it with the $response->withRedirect in slim3.

I looked around The slim\twig github (https://github.com/slimphp/Twig-View) but I couldn't find the document on how to pass The array over to twig using the $response->withRedirect or for my insanity is it just perfectly fine using $this->view->render

my slim 3 view setup is

$container['view']=function($container){
    $view =  new \Slim\Views\Twig('../app/Views',['cache' => false,'debug' => true]);
    $view->addExtension(new \Slim\Views\TwigExtension(
        $container->router, 
        $container->request->getUri()
        ));

        $view->addExtension(new \Twig_Extension_Debug());
    return $view;
};

Thank you.

Newbie2016
  • 517
  • 3
  • 6
  • 11
  • Possible duplicate of [How to redirect and store data for the request after the redirect in Slim 3](http://stackoverflow.com/questions/40656208/how-to-redirect-and-store-data-for-the-request-after-the-redirect-in-slim-3) – jmattheis Jan 03 '17 at 13:28
  • Thanks , that cleared things up for me. – Newbie2016 Jan 03 '17 at 14:16

0 Answers0