Spring 使用thymeleaf在另一个变量中显示一个变量
我有一个th:每个循环中都有一个显示按钮Spring 使用thymeleaf在另一个变量中显示一个变量,spring,spring-mvc,thymeleaf,Spring,Spring Mvc,Thymeleaf,我有一个th:每个循环中都有一个显示按钮 <li th:id="${'button-' + row.name }" th:unless="${row.name == 'linkedin' or row.name == 'slideshow'}" class="collection-item avatar" th:each="row, rowStat: *{arButtons}"> <img th:src="${'/images/buttons/' + row.n
<li th:id="${'button-' + row.name }" th:unless="${row.name == 'linkedin' or row.name == 'slideshow'}" class="collection-item avatar" th:each="row, rowStat: *{arButtons}">
<img th:src="${'/images/buttons/' + row.name + '.png'}" th:alt="${row.name}" class="circle"/>
<div class=" input-field col s12">
<input th:field="*{arButtons[__${rowStat.index}__].name}" type="hidden" />
<input th:field="*{arButtons[__${rowStat.index}__].data}" th:id="${'button-'+rowStat.index}" type="text" class="validate" />
<label th:if="${row.name == 'call'}" th:for="${'button-'+rowStat.index}" th:text="${call}"> Phone number </label>
<label th:if="${row.name == 'mail'}" th:for="${'button-'+rowStat.index}" th:text="${mail}"> Email </label>
<label th:if="${row.name == 'link'}" th:for="${'button-'+rowStat.index}" th:text="${link}"> Web Link </label>
<label th:if="${row.name == 'video'}" th:for="${'button-'+rowStat.index}" th:text="${video}"> Video </label>
</div>
</li>
现在我不想每次都检查行。为了显示方便的文本,有没有一种方法可以使用
<label th:for="${'button-'+rowStat.index}" th:text="${${row.name}}"> </label>
请不要有任何想法 查看Thymeleaf的功能。对于你的情况,我想
th:text="${__(${row.name})__}"
请注意,您应该使用双下划线,并且可以使用括号,但这对我来说更清楚请查看Thymeleaf的功能。对于你的情况,我想
th:text="${__(${row.name})__}"
请注意,您应该使用双下划线,括号可以省略,但对我来说更清楚愚蠢的我,这很有效!我没有意识到处理可以用这种方式处理变量。谢谢!我真傻,这很有效!我没有意识到处理可以用这种方式处理变量。谢谢!