How can I handle hash keys containing illegal identifier characters in Template Toolkit?

后端 未结 1 1138
离开以前
离开以前 2021-01-17 09:11

In Template Toolkit, if I have the following variable containing a hashref:

[% 
   artist = {
     \'life-span\' => \'1975 to 1987\',
   }
%]
相关标签:
1条回答
  • 2021-01-17 09:43

    You can use the item vmethod: [% artist.item('life-span') %].

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