How to combine two string in twig?

前端 未结 4 2029
粉色の甜心
粉色の甜心 2021-02-01 12:25

I want to do something like this:

{% set c=a+b %}

Where a and b are strings.
How can I do it?

4条回答
  •  逝去的感伤
    2021-02-01 13:01

    A clearer example for the {% block page %}...{% endblock %}:

    {% block page %}
        {% set page = page | merge({
        "title"       : branchName,
        "description" : "This description has "~branchName~" as its title"
        }) %}
        {{ parent() }}
    {% endblock %}
    

    A clearer example for the {% block content %}...{% endblock %}:

    {% block content %}
        This is just a sample string for {{ branchName }} that needs no concatenation
    {% endblock %}
    

提交回复
热议问题