Mercurial > hg > dml-open-vis
annotate src/Kachkaev/JstmplBundle/Controller/JstmplController.php @ 0:493bcb69166c
added public content
author | Daniel Wolff |
---|---|
date | Tue, 09 Feb 2016 20:54:02 +0100 |
parents | |
children |
rev | line source |
---|---|
Daniel@0 | 1 <?php |
Daniel@0 | 2 |
Daniel@0 | 3 namespace Kachkaev\JstmplBundle\Controller; |
Daniel@0 | 4 |
Daniel@0 | 5 use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
Daniel@0 | 6 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; |
Daniel@0 | 7 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
Daniel@0 | 8 |
Daniel@0 | 9 class JstmplController extends Controller |
Daniel@0 | 10 { |
Daniel@0 | 11 public function indexAction($name) |
Daniel@0 | 12 { |
Daniel@0 | 13 foreach ($this->container->getParameter('jstmpl.source.patterns') as $v) { |
Daniel@0 | 14 try { |
Daniel@0 | 15 $response = $this->render(str_replace('{name}',$name, $v)); |
Daniel@0 | 16 return $response; |
Daniel@0 | 17 } catch (\InvalidArgumentException $e) { |
Daniel@0 | 18 } |
Daniel@0 | 19 } |
Daniel@0 | 20 |
Daniel@0 | 21 throw new NotFoundHttpException(); |
Daniel@0 | 22 } |
Daniel@0 | 23 } |