Home >Backend Development >PHP Tutorial >Detailed explanation of url parameter passing examples in PHP

Detailed explanation of url parameter passing examples in PHP

小云云
小云云Original
2018-03-29 15:30:122651browse

This article mainly shares with you the detailed explanation of url parameter passing examples in PHP, hoping to help everyone.

8.9 Volist tag

The Volist tag is mainly used to loop out data sets or multi-dimensional arrays in templates.

##volist tag (loop output data) CloseNon-closed tagAttribute
name (required): the data template variable to be output


id( Required): loop variable


offset (optional): offset of the data to be output


length (optional): length of the output data


key (optional): the key variable of the loop, the default value is i


mod (optional): modulo the key value, the default is 2


empty (optional): The string displayed if the data is empty

Usually the result returned by the select method of the model is a two-dimensional array, which can be used directly volist tag for output.

In Action, first assign a value to the template:

    $User = M('User');
    $list = $User->selct();
    $this->assign('list',$list);
The template is defined as follows, and the user's number and name are output in a loop:

    <volist name="list" id="vo">
    {$vo.id}
    {$vo.name}
    </volist>

{volist name=&#39;results&#39; id=&#39;result&#39; }
url=&#39;index.php?id={$result[&#39;id&#39;]}&#39;
{/volist}

Related recommendations:

php encodes URL parameters and decoding parsing

The above is the detailed content of Detailed explanation of url parameter passing examples in PHP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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