button_primary
宏如何在Twig引擎中調用button
宏?我已經試過這 的解決方案,但它不工作,它說,功能「按鈕」不存在:在Twig中調用另一個宏裏面的宏
{% macro button(label, type, size) %}
{% set type = type|default('default') %}
{% set size = size|default('large') %}
{% set cls = ['btn'] %}
<a href="#" class="{{ cls|join(' ') }}">{{ label }}</a>
{% endmacro %}
{% macro button_primary(label, size) %}
{{ button(label, 'primary', size) }}
{% endmacro %}
好點。在問題發生時我不記得那個通知。不管怎麼說,多謝拉... – gremo 2012-11-29 09:29:49