AngularJS-Twig conflict with double curly braces

前端 未结 11 825
孤独总比滥情好
孤独总比滥情好 2020-11-22 14:39

As you know, both angular and twig has common control construction - double curly braces. How can I change default value of Angular?

I know that I can do it in Twig,

11条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-22 15:35

    Alternatively you can change the characters used by Twig. This is controlled by the Twig_Lexer.

    $twig = new Twig_Environment();
    
    $lexer = new Twig_Lexer($twig, array(
        'tag_comment'   => array('[#', '#]'),
        'tag_block'     => array('[%', '%]'),
        'tag_variable'  => array('[[', ']]'),
        'interpolation' => array('#[', ']'),
    ));
    $twig->setLexer($lexer);
    

提交回复
热议问题