Symfony2 Twig stop escaping path

前端 未结 2 1954
故里飘歌
故里飘歌 2020-12-06 14:27

I need to put unescaped URL generated from path into input element.

routing.yml

profile_delete:
  pattern: /student_usun/{id}
  defa         


        
2条回答
  •  盖世英雄少女心
    2020-12-06 15:05

    If you're using:

    'url_decode' => new \Twig_Function_Method($this, 'urlDecode') 
    

    and receive an error:

    Error: addFilter() must implement interface Twig_FilterInterface, instance of Twig_Function_Method given 
    

    replace:

    new \Twig_Function_Method($this, 'urlDecode')" 
    

    with:

    new \Twig_Filter_Method($this, 'urlDecode')"
    

    Best

提交回复
热议问题