tp笔记


1.常用知识点

<h5>thinkcmf框架的模板文件</h5> <p>目录为:thinkcmf(项目文件名)\public\themes\admin_simpleboot3\zpeadmin(应用名)\ceshi(控制器名)\test(方法名).html</p> <h5>渲染模板</h5> <p>以下fetch()函数,会将数据渲染到对应同名方法的html中,如:\public\themes\admin_simpleboot3\zpeadmin\ceshi\user_list.html</p> <pre><code class="language-php">public function user_list() { $ceshi = "abcdefg"; $this-&gt;assign("jieguo",$ceshi);//在php将数据abcdefg放到$ceshi中,再将$ceshi放到"jieguo"中,在html输出{$jieguo}可以拿到abcdefg return $this-&gt;fetch();//将数据渲染(展示)到对应html中 }//</code></pre> <p>当运行user_list()这个函数时,会自动访问user_list.html,显示最终的页面</p> <h5>thinkcmf中查询列表</h5> <p>使用paginate()进行分页查询,该框架已经将select()函数集成到paginate()函数中</p> <pre><code class="language-php">Db::name("member")-&gt;paginate(2);//paginate函数中的参数表示一页多少条数据</code></pre> <h5>fetch该函数会自动渲染对应的html文件并显示出来</h5> <p>return $this-&gt;fetch();</p>

页面列表

ITEM_HTML