Home  >  Article  >  Backend Development  >  PHP框架queryphp课程:入门六 视图模板

PHP框架queryphp课程:入门六 视图模板

WBOY
WBOYOriginal
2016-06-13 13:04:29826browse

PHP框架queryphp教程:入门六 视图模板

使用原生php代码标签?

看手册:?

PHP 提供了一些流程控制的替代语法,包括 if,while,for,foreach 和 switch。

替代语法的基本形式是把左花括号({)换成冒号(:),把右花括号(})

分别换成 endif;,endwhile;,endfor;,endforeach; 以及 endswitch;。?

还有不少可以做标签呢?

url_for()为url地址修改函数请使用这个函数设置地址?

模板标签使用url_for()函数例子:

  • ">添加新记录
  • ">数据列表
  • url_for();多加一个true参数是一定会返回动态地址

    ">

    ?

    模板标签使用 foreach循环例子:

    ?
    ?
    ?
    CURD演示?
    ?

    ?
      ?
    • ">添加新记录
    • ?
    • ">数据列表
    • ?
      ?
      ?
      ?
      ?
      ? ?
      ?
      ? ?
      ?
      ? ?
      ?
      ? ?
      ?
      ? ?
      ?
      ? ?
      ?
      ?
      ?
      ? $value):?> 循环开始注意:号
      ?
      ?
      ? ?
      ?
      ? ?
      ?
      ? ?
      ?
      ? ?
      ?
      ? ?
      ?
      ? ?
      ?
      ?
      ?
      ? //循环结束
      ?
      ?
      ? ?
      ?
      ? ?
      ?
      ? ?
      ?
      ? ?
      ?
      ? ?
      ?
      ? ?
      ?
      ?
      ?
      序号类名typeid   
      ">显示">编辑">删除
            
      ?
      ?
      echo $pager->getWholeBar(url_for("curd/index/page/:page")); //输出分页导航 :page 将会被分页页数替换
      ?>?
      ?
      ?
      ?


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