I have a problem with configuration of my project and I can't see where is the mistake...
AppKernel.php ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
...
new CMS\CoreBundle\CMSCoreBundle(),
];
app/config/routing.yml
cms_core:
resource: "@CMSCoreBundle/Resources/config/routing.yml"
prefix: /
src/CMS/CoreBundle/Resourcers/config/routing.yml
cms_core_homepage:
path: /
defaults: { _controller: CMSCoreBundle:Default:index }
src/CMS/CoreBundle/Resources/views/index.html.twig
{% extends "@CMSCoreBundle/template.html.twig" %}
{% block content %}
test
{% endblock %}
src/CMS/CoreBundle/Resources/views/template.html.twig
{% block content %}
Template block
{% endblock %}
And I'm getting this message
There are no registered paths for namespace "CMSCoreBundle" in CMSCoreBundle::index.html.twig at line 1.
Where is the mistake please ? Thank you guys.
I think you have 2 ways to fix it.
you can add your bundle to the path
#app/config/config.yml
twig:
paths:
"%kernel.root_dir%/../src/CMS/CoreBundle/Resources/views/": CMSCoreBundle
Or try to extend your template like that
{% extends "CMSCoreBundle:template.html.twig" %}
I'm not 100% sure for the 2nd solution.
Hope it may helps you