tp5

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

cd  ../ 進入D/phpstudy/www/tp5中   從tp5中複製build文件而後 把build文件放入應用目錄(application)中    而後再cmd中php think build進行配置。、app

 

配置獲取composer

use think\acade\Config;或者use Config;    獲取某個配置的值echo config('app.app_name'); 後面不帶參數是原樣輸出fetch

                           echo config('app.app_name','ymt');後面帶參數是設置ui

讀取全部的配置參數:dump((config));this

 

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

模板賦值:ip

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

 

視圖渲染string

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運行

相關文章
相關標籤/搜索