Home > Backend Development > PHP Tutorial > How art-template's {{}} loop supports conditional indexing.

How art-template's {{}} loop supports conditional indexing.

WBOY
Release: 2016-07-06 13:52:48
Original
1773 people have browsed it

For example
{{each data as value index}}

<code><li><a href="#">{{index}}</a></li></code>
Copy after login
Copy after login

{{/each}}
Pagination bar, one pagination for every 10 columns, and only 5 paginations at most.
How to do it using {{}} syntax?

Reply content:

For example
{{each data as value index}}

<code><li><a href="#">{{index}}</a></li></code>
Copy after login
Copy after login

{{/each}}
Pagination bar, one pagination for every 10 columns, and only 5 paginations at most.
How to do it using {{}} syntax?

Your needs should be controlled at the back end. The front end each is only responsible for looping, and the front end supports if judgment
{{if index 1}}{{/if}}

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template