comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:493bcb69166c
1 <?php
2
3 namespace Kachkaev\JstmplBundle\Controller;
4
5 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
7 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
8
9 class JstmplController extends Controller
10 {
11 public function indexAction($name)
12 {
13 foreach ($this->container->getParameter('jstmpl.source.patterns') as $v) {
14 try {
15 $response = $this->render(str_replace('{name}',$name, $v));
16 return $response;
17 } catch (\InvalidArgumentException $e) {
18 }
19 }
20
21 throw new NotFoundHttpException();
22 }
23 }