37 lines
914 B
PHP
37 lines
914 B
PHP
|
<?php
|
||
|
|
||
|
namespace AppBundle\Controller;
|
||
|
|
||
|
use Symfony\Component\HttpFoundation\Request;
|
||
|
use Trinity\Bundle\ContentManagerBundle\Controller\PageController;
|
||
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||
|
use Symfony\Component\Routing\Annotation\Route;
|
||
|
use AppBundle\Entity\Category;
|
||
|
use AppBundle\Form\CategoryType;
|
||
|
|
||
|
/**
|
||
|
* class CategoryController.
|
||
|
*
|
||
|
* @author Simon Vieille <simon@deblan.fr>
|
||
|
*/
|
||
|
class CategoryController extends Controller
|
||
|
{
|
||
|
/**
|
||
|
* Categories page.
|
||
|
*
|
||
|
* @Template()
|
||
|
* @Route("/", name="example")
|
||
|
*
|
||
|
* @param Request $request
|
||
|
*
|
||
|
* @return \Symfony\Bundle\FrameworkBundle\Controller\Response
|
||
|
*/
|
||
|
public function indexAction(Request $request)
|
||
|
{
|
||
|
return [
|
||
|
'form' => $this->createForm(CategoryType::class, new Category())->createView(),
|
||
|
];
|
||
|
}
|
||
|
}
|