I have a route like this: index:
path: /{category}
defaults: { _controller: AcmeDemoBundle:Index:index, category: "default" }
requirements:
categoria: "foo|bar|this|or|that"
and the relative controller is:
<?php
namespace Acme\DemoBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class IndexController extends Controller
{
public function indexAction($category)
{
$data = array("Content1", "Content2");
return $this->render('AcmeDemoBundle:Default:index.html.twig', array('data' => $familiari));
}
}
?>
What if I want to use the value stored in $category inside the template index.html.twig? I tried passing the variable category with the render function but I get an error! Thanks beforehand!