First, I know this is a horrible thing to do and should be done in controller logic only, but what I'm trying to do is create a custom redirect tag in Twig that fires a Silex redirect.
I have a custom node that outputs the following into the doDisplay template:
return $this->getEnvironment()->getExtension('silex')->getApp()->redirect('/', 301);
Basically this gets the Twig environment and the extension I created which has a getApp method which returns the Silex $app variable, which contains the redirect method.
But this only returns Array() to the screen. Any suggestions?
No comments:
Post a Comment