<?php

namespace Neag\MainBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Response; 
use Neag\MainBundle\Entity\Article;
use Neag\MainBundle\Entity\Category;

class MainController extends ControllerAbstract
{
    /**
     * @Route("/")
     * @Template("NeagMainBundle:Main:main.html.twig")
     */
    public function mainAction()
    {
        $globals = $this->get('globals');
        $templating = $this->get('templating');
        
        $is_mobile = $globals->isMobile();                 
        
        $params = Array(
            'content' => '',
        );
        if (!$is_mobile) {
            return new Response($templating->render(
                'NeagMainBundle:Main:main.html.twig',
                $params
            ));
        } else {
            return new Response($templating->render(
                'NeagMainBundle:Main:main_m.html.twig',
                $params
            )); 
        }
    }

}
