There is no extension able to load the configuration for “web_profiler”

By default, WebProfilerBundle is loaded in dev and test environments only. Find this code snippet in your AppKernel class: if (in_array($this->getEnvironment(), array(‘dev’, ‘test’))) { $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); // … } and append your new environment name to the array: array(‘dev’, ‘test’, ‘dp’)

Nested if else in Twig

elseif needs to be single word tag/keyword and expression shouldn’t have parenthesis same as if expression. http://twig.sensiolabs.org/doc/tags/if.html <body {% if page|default(‘login’) == ‘login’ %} class=”login” {% elseif page == ‘other’ %} class=”login” {% else %} class=”noclass” {% endif %}> </body>

Doctrine2 conversion error

You probably changed a field from type string to type array in your entity but already have data the database. It’s failing at trying to convert an empty string from the database to an array. If it’s a development database, simply delete it and create it again, or just delete the offending rows. Or you … Read more

Symfony 2 – Working with assets

Regarding images, if you added it into your public folder, I think there’s no need to perform assets:update However, if you add the image within the resources folders of a bundle, you might have to, depending on your OS and which options you used when called assets:install If you’re using an OS which supports symlinks … Read more

filter boolean variable in a twig template

Quick way to achieve that is to use the ternary operator: {{ bool_var ? ‘Yes’:’No’ }} http://twig.sensiolabs.org/doc/templates.html#other-operators You could also create a custom filter that would do this. Read about custom TWIG extensions – http://symfony.com/doc/current/cookbook/templating/twig_extension.html

‘where not in’ query with doctrine query builder

You need to use query builder expressions, and this means you need access to the query builder object. Also, the code is easier to write if you generate the subselect list ahead of time: $qb = $em->createQueryBuilder(); $nots = $qb->select(‘arl’) ->from(‘$MineMyBundle:MineAssetRequestLine’, ‘arl’) ->where($qb->expr()->eq(‘arl.asset_id’,1)) ->getQuery() ->getResult(); $linked = $qb->select(‘rl’) ->from(‘MineMyBundle:MineRequestLine’, ‘rl’) ->where($qb->expr()->notIn(‘rl.request_id’, $nots)) ->getQuery() ->getResult();