$ php app/console doctrine:mapping:import --force AppBundle yml $ php app/console doctrine:mapping:convert annotation ./src $ php app/console doctrine:generate:entities AppBundle Referencias: http://symfony.com/doc/current/cookbook/doctrine/reverse_engineering.html https://librosweb.es/libro/buenas_practicas_symfony/capitulo_2/los_bundles_de_la_aplicacion.html
Notas de la Etiqueta: symfony
Cómo resolver el conflicto entre AngularJS y Twig en Symfony
Este artículo es de Tommy Ku publicado en http://blog.tommyku.com/blog/resolve-syntax-conflict-between-angularjs-and-twig
Resolve syntax conflict between AngularJS and Twig
Written on By Tommy Ku
AngularJS uses double curly braces (e.g. {{var}}) to wrap the variables in its HTML view while Twig use precisely the same syntax to wrap the variables. Should you use Twig to render a AngularJS app, the HTML view template will simply be messed up.
There are two solutions suggested by the online community:
- Convert all double curly braces into literal strings
As suggested by the official documentation of Twig, when rendering literal {{ }} one can ‘escape’ it like the following.
{{ -> {{ '{{' }}
or{{var}} -> {{ '{{var}}' }}
No doubt the AngularJS template will look terrible, but this solution resolves the conflict without tweaking the options of both AngularJS and Twig.
- Configure AngularJS to use other braces such as
{[{var}]}
(or whatever you like) instead.In your AngularJS app script, add the following config.
angular.module('app', []).config(function($interpolateProvider){ $interpolateProvider.startSymbol('{[{').endSymbol('}]}'); });
This method breaks less of the syntax in both Twig and AngularJS, so it is strongly suggested.
- Twig also provide a tag for displaying raw content. Everything inside
vertatim
block is not parsed by Twig engine.{% verbatim %} // everything of your angularJS template {% endverbatim %}
This one should be the least obstructive and the easiest to implement.