- 命令行
先在cmd进入项目目录,再执行命令- 生成
index
模块的Blog
控制器类库文件:php think make:controller index/Blog - 如果仅仅生成空的控制器则可以使用:php think make:controller index/Blog --plain
- 清除缓存文件(runtime目录):php think clear
- 清除指定目录下的文件:php think clear --path d:www p5 untimelog
- 生成
- 引用模板(路径以 项目目录/public/ 路径下为起点):{include file="public/header,public/menu"/}
或者直接包含一个模版文件名(包含完整路径),例如:{include file="../application/view/default/public/header.html"/}
支持传入参数,如:{include file="Public/header" title="$title" keywords="开源WEB开发框架"/}
模板中的使用方法为:1.<html xmlns="http://www.w3.org/1999/xhtml"> 2.<head> 3.<title> [title] </title> #变量的使用方法 4.<meta name="keywords" content=" [keywords] " /> 5.</head>
- 在模板中输出文件:$this->assign(['data1'=>$data1,'data2'=>$data2]);
TP手册学习第三天
免责声明:文章转载自《TP手册学习第三天》仅用于学习参考。如对内容有疑问,请及时联系本站处理。
上篇安装dcm4chee-arc-light-5.4.1-mysql步骤poj1966Cable TV Network(无向图最小点割集 ISAP+邻接矩阵)下篇
宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=