Skip to content

Twig Templates

pajtai edited this page Oct 2, 2012 · 2 revisions

Check if array empty if array Set a variable. If and for loops.

Twig templates

    {% set allTokens = controller.getAllTokens() %}

    {% if allTokens %}
        {% for token in allTokens %}
        <tr>
            <td>{{token.apikey}}</td>
            <td>{{token.appid}}</td>
            <td>{{token.deviceid}}</td>
            <td>{{token.valid}}</td>
            <td>{{token.datecreated.sec|date("m/d/Y")}}</td>
            <td><i class="icon-trash" rel="{{token.deviceid}}"></i></td>
        </tr>
        {% endfor %}
    {% else %}
        <tr>
            <td colspan="6">There are no tokens.</td>
        </tr>
    {% endif %}

Total of 183 pages.
Total of 67 pages not in main tree.
Total of 147 nodes.
This Sidebar and the "Linked From" sections created by Wiki Buddy
The full tree is at _WB-Full-Tree

Clone this wiki locally