tp5

cmd 命令提示符(自动生成文件)

cd  ../ 进入D/phpstudy/www/tp5中   从tp5中复制build文件然后 把build文件放入应用目录(application)中    然后再cmd中php think build进行配置。、

配置获取

use thinkacadeConfig;或者use Config;    获取某个配置的值echo config('app.app_name'); 后面不带参数是原样输出

                           echo config('app.app_name','ymt');后面带参数是设置

读取所有的配置参数:dump((config));

 跨模板渲染 return $this->fetch('admin@member/edit');

模板赋值:

$this->assign('');//赋值
$this->view('');//赋值
$this->fetch('');//赋值

视图渲染

return $this->fetch();

return view();

如果需要全局替换的话,可以直接在template.php配置文件中添加:

'tpl_replace_string' =>[

'__STATTC__'=>/static',

'__JS__'=>'/static/jacascript',

]

验证码:cd ../../返回到c盘中,d:进入到d盘中 ,然后cd  在进入phpstudy中  cd进入www  在cd进入项目中 composer require topthink/think-captcha运行

原文地址:https://www.cnblogs.com/ysboke/p/9946753.html