Moved document related stuff into DocumentController

This commit is contained in:
Polonkai Gergely 2012-07-17 23:33:31 +02:00
parent 9f49b70d67
commit 1b55b079f4
3 changed files with 25 additions and 15 deletions

View File

@ -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,
);
}
}

View 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,
);
}
}