Symfony2 Twig extension

后端 未结 1 1470
囚心锁ツ
囚心锁ツ 2021-02-08 01:15

I have some problem to implement twig extension. I need to create my own filter (a substr filter). So I have thought to use twig extension.

I created a folder named \"Ex

相关标签:
1条回答
  • 2021-02-08 02:22

    Replace this

    namespace Bundle\WebsiteBundle\Extension;
    

    By this

    namespace MyApp\Bundle\WebsiteBundle\Extension;
    

    And for what your need dir Bundle/WebsiteBundle?
    Is Bundle is not enough?

    Your can see here how I implement this https://github.com/azat/blog/blob/master/src/Blog/WebBundle/Twig/Extension/WebExtension.php

    0 讨论(0)
提交回复
热议问题