Moved everything under annotations.

Some review is still needed.
This commit is contained in:
Polonkai Gergely
2012-07-13 12:07:21 +02:00
parent 60b5eecbc8
commit 00190c3e37
41 changed files with 3264 additions and 2509 deletions

View File

@@ -2,21 +2,28 @@
namespace KekRozsak\FrontBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use KekRozsak\FrontBundle\Form\Type\UserType;
class DefaultController extends Controller
{
/**
* @Route("/", name="KekRozsakFrontBundle_homepage")
*/
public function homepageAction()
{
$mainPageArticle = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:Article')->findOneBy(array('main_page' => 1), true, array('created_at', 'DESC'), 1);
$mainPageArticle = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:Article')->findOneBy(array('mainPage' => 1), true, array('createdAt', 'DESC'), 1);
if (!$mainPageArticle)
throw $this->createNotFoundException('A keresett cikk nem létezik!');
return $this->forward('KekRozsakFrontBundle:Default:article', array('articleSlug' => $mainPageArticle->getSlug()));
}
/**
* @Route("/cikk/{articleSlug}", name="KekRozsakFrontBundle_article")
*/
public function articleAction($articleSlug)
{
$article = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:Article')->findOneBySlug($articleSlug);
@@ -29,6 +36,9 @@ class DefaultController extends Controller
));
}
/**
* @Route("/profil", name="KekRozsakFrontBundle_profile_edit")
*/
public function profileEditAction()
{
$user = $this->get('security.context')->getToken()->getUser();