<?php

namespace AppBundle\Controller;


use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class CategoryController extends Controller {

    /**
     * @Route("/categories", name="app_categories")
     * @Method("GET")
     * @Template()
     */
    public function categoriesAction() {
        $categoryRepository = $this->get('category_repository');
        return array('categories' => $categoryRepository->findAll());
    }

}