26 Kasım 2011, 23:57
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 [...]
21 Eylül 2011, 23:01
Twig: {{ app.request.attributes.get(‘_route’) }} Php: $app->getRequest()->attributes->get(‘_route’) Controller: $this->container->get(‘request’)->attributes->get(‘_route’)
21 Eylül 2011, 22:37
var myArray = ['foo', 'bar']; var elementIndex = myArray.indexOf(‘bar’); // Finding index of the element we want to remove if (elementIndex != -1) { myArray.splice(elementIndex, 1); } console.log(myArray);