Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twig: support namespaced bundle paths #456

Open
gharlan opened this issue Mar 10, 2015 · 7 comments
Open

Twig: support namespaced bundle paths #456

gharlan opened this issue Mar 10, 2015 · 7 comments

Comments

@gharlan
Copy link

gharlan commented Mar 10, 2015

http://symfony.com/doc/current/cookbook/templating/namespaced_paths.html

I get "Missing template" for paths like this:

{% include "@App/Foo/bar.html.twig" %} {# Missing template #}
{# equivalent to: #}
{% include "AppBundle:Foo:bar.html.twig" %}

And I would like to configure which style should be used for autocompletion.

@Koc
Copy link
Contributor

Koc commented Mar 17, 2015

    public function viewAction(LandingTemplate $landingTemplate = null, $simple = false)
    {
        $template = '@MetalProject/Wizzard/landing_page.html.twig'; // ctrl+click doesn't work here
        if ($simple) {
            $template = '@MetalProject/Wizzard/landing_simple_page.html.twig';
        }
    }

Can you look at this, @Haehnchen please?

@Haehnchen
Copy link
Owner

@MetalProject what is the pathname of this alias? is it a compiled xml path, some xml example?
possible related #450, #429

@Koc
Copy link
Contributor

Koc commented Mar 18, 2015

    <service id="twig.loader" class="Symfony\Bundle\TwigBundle\Loader\FilesystemLoader">
      <tag name="twig.loader"/>
      <argument type="service" id="templating.locator"/>
      <argument type="service" id="templating.name_parser"/>
      <!-- ... -->
      <call method="addPath">
        <argument>Z:\home\dev\metalloprokat\src\Metal\ProjectBundle/Resources/views</argument>
        <argument>MetalProject</argument>
      </call>
      <!-- ... -->
    </service>

@Haehnchen
Copy link
Owner

@Koc your issue is phpstorm9 eap related see #450 for updates

@apfelbox
Copy link

This happens for me in every place where you can define templates, even "regular" ones.
Only the x:y:z syntax works, so no direct templates

/**
 * @Template("base.html.twig")
 */

nor the @ namespaced syntax

/**
 * @Template("@App/base.html.twig")
 */

This used to work in previous versions. Again, this doesn't seem related to #450, as this issue here also happens in regular @Template annotations and ->render() calls.

screen shot 2015-08-23 at 13 07 39

@apfelbox
Copy link

Is there any update on this one, @Haehnchen? This happens for every template in my codebase, as we exclusively use this notation.

@f-palomares
Copy link

I had a similar issue using a symlink for the base project path.
Closing the project and opening with a direct path solved the issue for me
Hope it helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants