‘symfony2’ ile ilgili yazılar

Symfony 2: Setting Cookies

Symfony 2 is great but it’s not well documented yet and there is no documentation about cookie handling as well. After a few code digging I’ve found the solution. As we know, basically, cookies are just HTTP headers and you can get them from requests or send with responses. Symfony\Component\HttpFoundation\Response class has a public property named [...]

Symfony 2: Getting Current Route in Twig

Twig: {{ app.request.attributes.get(‘_route’) }} Php: $app->getRequest()->attributes->get(‘_route’) Controller: $this->container->get(‘request’)->attributes->get(‘_route’)