Deprecated: imwpcache\f884414bce24ee67f\f73723ec7b1919fa5::__construct(): Implicitly marking parameter $YECBGYFECGEAFWHA as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/www.chuangxiangniao.com/wp-content/plugins/imwpcache-dist/build/f884414bce24ee67ff73723ec7b1919fa5.php on line 2

Deprecated: imwpcache\f884414bce24ee67f\f73723ec7b1919fa5::__construct(): Implicitly marking parameter $BBWFDDBHHYHDXXAB as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/www.chuangxiangniao.com/wp-content/plugins/imwpcache-dist/build/f884414bce24ee67ff73723ec7b1919fa5.php on line 2
thinkphp5.1使用Smarty模板引擎_创想鸟

thinkphp5.1使用Smarty模板引擎

thinkphp5.1使用Smarty模板引擎

Thinkphp5.1使用Smarty模板引擎

习惯了使用smarty的小伙伴,如果不想修改已有的模板代码,可以直接使用composer安装smarty库,修改模板配置文件就可以直接使用smarty模板了
think-smarty
thinkphp5.1smarty 引擎驱动

安装方法
使用composer安装模版引擎方法: composer require emmetltd/think-smarty

thinkphp5.1 配置template.php文件中参数

return [// 模板引擎类型 支持 php think 支持扩展'type' => 'Smarty',// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法'auto_rule' => 1,// 模板路径'view_path' => '',// 模板后缀'view_suffix' => 'html',// 模板文件名分隔符'view_depr' => '_', //DIRECTORY_SEPARATOR,// 模板引擎普通标签开始标记'tpl_begin' => ' '}>',// 标签库标签开始标记'taglib_begin' => '{',// 标签库标签结束标记'taglib_end' => '}','view_replace_str' => [ //字符替换部分'/Upfiles/'=>'http://www.emmetltd.com/Uploads/',],];

那么在控制器 index/index::index 中 return view();时会加载模板 index/view/index_index.html

推荐教程:《TP5》

以上就是thinkphp5.1使用Smarty模板引擎的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/89210.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
Perplexity AI可以解读天文数据 Perplexity AI宇宙观测报告生成
上一篇 2025年11月18日 03:46:08
VSCode如何设置默认启动项_VSCode默认启动配置设置
下一篇 2025年11月18日 03:48:10

相关推荐

发表回复

登录后才能评论
关注微信