I want to set %kernel.project_dir%/templates instead of %kernel.root_dir%/Resources/views for the projects with Symfony Flex. What about a new configuration?
easy_admin:
design:
templates_dir: '%kernel.project_dir%/templates'
twig:
paths:
- '%kernel.project_dir%/templates'
?
@grachevko This doesn't work. The path is hard coded: https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Configuration/ConfigManager.php#L200
@hason really. As we have $backendConfig variable in this method, i guess path can be configurable.
@hason Take a look at this http://symfony.com/doc/current/templating/namespaced_paths.html#registering-your-own-namespaces
@yceruto TemplateConfigPass.php don't use twig paths to Overriding the Default Templates By Convention. I guess here is the problem
Now after this https://github.com/javiereguiluz/EasyAdminBundle/commit/3d83921a2f106d23423437014b6c8349851b760e is possible to modify the main template directory overriding the %easyadmin.templates_dir% parameter.
Even though there is a workaround out-of-the-box in play for all bundles https://stackoverflow.com/a/45220468/4224384 ;)
Even if this can be solved by 3d83921 I think this is a bug (and "easy" to solve it) so I'm reopening this and I'll submit a PR soon.
The real problem is that in the past we looked for the templates using hardcoded file paths and file_exists() calls. But the right way to look for templates is to use relative/logical template paths and ask Twig if the template exists. I'm trying to do that in #1748.