Moved document related stuff into DocumentController
This commit is contained in:
parent
9f49b70d67
commit
1b55b079f4
@ -77,19 +77,4 @@ class DefaultController extends Controller
|
||||
'saveSuccess' => $saveSuccess,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/dokumentum/{documentSlug}", name="KekRozsakFrontBundle_documentView")
|
||||
* @Template()
|
||||
*/
|
||||
public function documentViewAction($documentSlug)
|
||||
{
|
||||
$docRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:Document');
|
||||
if (!($document = $docRepo->findOneBySlug($documentSlug)))
|
||||
throw $this->createNotFoundException('A kért dokumentum nem létezik!');
|
||||
|
||||
return array(
|
||||
'document' => $document,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
25
src/KekRozsak/FrontBundle/Controller/DocumentController.php
Normal file
25
src/KekRozsak/FrontBundle/Controller/DocumentController.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace KekRozsak\FrontBundle\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
|
||||
class DocumentController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Route("/dokumentum/{documentSlug}", name="KekRozsakFrontBundle_documentView")
|
||||
* @Template()
|
||||
*/
|
||||
public function documentViewAction($documentSlug)
|
||||
{
|
||||
$docRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:Document');
|
||||
if (!($document = $docRepo->findOneBySlug($documentSlug)))
|
||||
throw $this->createNotFoundException('A kért dokumentum nem létezik!');
|
||||
|
||||
return array(
|
||||
'document' => $document,
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user