Вопрос

I'm new to freemarker. eg: a variable named content = "http://www.xyz.com/sites/" . so how to check in ftl

        <#if content has "/sites/" in it>
                  do something
        </#if>
Это было полезно?

Решение

You can use a regular expression and the matches freemarker builtin.

<#if content?matches(".*/sites/.*")>
   do something
</#if>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top