require smarty.class.php 报错,Smarty 报错
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
temp.tpl:{config_load file="../configs/a.conf"}{#s#}
a.conf:s='测试测试'
报错Fatal error: Uncaught exception 'SmartyException' with message 'Unable to read config file '../configs/a.conf'' in C:\wamp\www\smarty\libs\sysplugins\smarty_internal_resource_file.php:68 Stack trace: #0 C:\wamp\www\smarty\libs\sysplugins\smarty_config_source.php(86): Smarty_Internal_Resource_File->getContent(Object(Smarty_Config_Source)) #1 C:\wamp\www\smarty\libs\sysplugins\smarty_internal_config_file_compiler.php(81): Smarty_Config_Source->__get('content') #2 C:\wamp\www\smarty\libs\sysplugins\smarty_internal_config.php(189): Smarty_Internal_Config_File_Compiler->compileSource(Object(Smarty_Internal_Config)) #3 C:\wamp\www\smarty\libs\sysplugins\smarty_internal_config.php(214): Smarty_Internal_Config->compileConfigSource() #4 C:\wamp\www\smarty\templates_c\187938f6ec55068ed23f0f2de8d126b1ae3149c7.file.temp.tpl.php(36): Smarty_Internal_Config->loadConfigVars(NULL, 'local') #5 C:\wamp\www\smarty\libs\sysplugins\smarty_internal_templatebase.php(180): content_4fb7f6591b8ab2_26457252(Object(Smarty_Internal_Template)) #6 C:\w in C:\wamp\www\smarty\libs\sysplugins\smarty_internal_resource_file.php on line 68
自定义函数<?phprequire_once './libs/Smarty.class.php';$smarty=new Smarty;function myfun($args){$str="";for($i=0;$i<$args['times'];$i++){$str.="测试";}return $str;}$smarty->register_function("doloop","myfun");$smarty->display("temp.tpl");?>
temp.tpl:{doloop times="5"}
报错Fatal error: Uncaught exception 'SmartyException' with message 'Call of unknown method 'register_function'.' in C:\wamp\www\smarty\libs\sysplugins\smarty_internal_templatebase.php:806 Stack trace: #0 [internal function]: Smarty_Internal_TemplateBase->__call('register_functi...', Array) #1 C:\wamp\www\smarty\smarty.php(62): Smarty->register_function('doloop', 'myfun') #2 {main} thrown in C:\wamp\www\smarty\libs\sysplugins\smarty_internal_templatebase.php on line 806
我从smarty官方网站上下载了Smarty 3.1.8 [Smarty-stable.zip] Feb 20th, 2012文件啊stable这个单词是稳定的意思 我就下了这个包 解压后 我把里面的libs文件夹拷贝到我的www/smarty目录下,其它像在temp.tpl模板里运行{$smarty.server.SERVER_ADDR}这个语句可以正常显示啊,为什么就运行上面的config_load和自定义函数就不行啊
require smarty.class.php 报错,Smarty 报错相关推荐
- cmd mysql 报错_Mysql报错问题汇总
1 远程报错问题 报错问题:Host 'XXX' is not allowed to connect to this MySQL server 1.1 防火墙允许3306端口 首先控制面板--防火墙- ...
- Navicat 用ssh通道连接时总是报错 (报错信息:SSH:expected key exchange group packet form serve...
转:https://blog.csdn.net/qq_27463323/article/details/76830731 之前下了一个Navicat 11.0 版本 用ssh通道连接时总是报错 (报错 ...
- CMD终端关于pip报错,scrapy报错的一种处理方法
CMD终端关于pip报错,scrapy报错的一种处理方法 如果在终端输入pip,或scrapy,报如下错误: Fatal error in launcher: Unable to create pro ...
- nginx对PHP文件报File not found.错
问题描述 nginx对PHP文件报File not found.错 配置nginx+php5.4的时候,配置完成后,浏览器打开php文件就提示File not found.错误. 解决办法: fast ...
- Git、GitLab这辈子的错都报完了 You have not concludedUnlink of file、 Pulling is not possible、Your local changes
本人详解 作者:王文峰,参加过 CSDN 2020年度博客之星,<Java王大师王天师>作者 公众号:山峯草堂,非技术多篇文章,专注于天道酬勤的 Java 开发问题.中国国学.传统文化和代 ...
- mysql查找语句报错_MYSQL报错注入-WEB资讯专栏-DMOZ中文网站分类目录-免费收录各类优秀网站的中文网站目录....
目录 审计思路报错语句报错函数查询表floor报错函数讲解报错原理语句xpath语法报错函数讲解语句整数溢出报错exppowcot列名重复报错name_constjoin using几何函数报错不存在 ...
- 使用DmAPService脚本启动dmap服务报错,报错信息:“failed to get ps!”
问题描述 使用DmAPService脚本启动dmap服务报错,报错信息:"failed to get ps!" 排查解决 1.根据报错信息以及DmAPService服务脚本内容可以 ...
- 【H5微信授权】简单实现H5页面微信授权功能,微信开发者工具报错 系统错误,错误码-1,undefined解决办法【详细】
前言 最近写到了H5公众号,需要微信授权的功能. 这里记录一下授权的流程和踩了个坑 图片 授权代码执行后会跳转到授权的地方,没有授权的会有确认授权,授权过得会这样,直接自动登录,然后再跳转到中转页 授 ...
- eNSP:当电脑从win10升级到win11,却发现启动虚拟设备(路由或防火墙)时出现报错,报错代码为40,如何解决?
背景描述: 如何解决"当电脑从win10升级到win11,却发现启动虚拟设备(路由或防火墙)时,出现报错,报错代码为40"的问题呢?基于电脑升级win11,启动虚拟设备尤其是路由和 ...
- 报错已解决:@WebServlet报红,@Param报红
报错描述 基于Spring+idea创建JavaWeb项目,在LoginServlet类中出现@WebServlet报红,@Param报红. 报红消失前的操作:pom.xml文件中的<plugi ...
最新文章
- 图说子图同构算法——VF2算法(一)
- eclipse C/C++环境搭建
- 这个在Github有52100颗星星的项目,怎么还有人不知道鸭!
- charles 华为手机使用_华为手机EMUI9.0健康使用手机怎么用?如何控制手机使用时长?...
- 编造机中鼠标无法应用标题问题解答
- python3.5.2安装pygame_#Python3.6.2(32位) pip安装 和 pygame 环境配置
- 【转】用Qt生成dll类库及调用方法
- SpringBoot学习笔记(4):自定义的过滤器
- 基于C#语言的程序调用
- 卡巴斯基安全部队2013中文免费版【可免费使用一个月】
- CentOS7.5下载及安装过程
- 【图像分割】基于混洗Shuffled Complex Evolution实现图像分割附matlab代码
- 7条简单粗暴的工作建议
- Python如何获取 Jenkins构建日志
- MySQL中DELETE操作磁盘空间不会减少的原因
- Rancid cvs ViewVC 安装配置
- ImageLoader全局类配置 及图片展示配置(自定义缓存目录SD卡根目录)
- MES解决方案赋能「汽车改装行业」
- lasso的今世前身
- 为什么zoom虚拟背景无法添加,zoom网课怎么用虚拟背景
热门文章
- kettle Windows下载
- 无法访问局域网的文件服务器,局域网共享文件夹不能访问
- 利用DeskPins软件将windows窗口置顶
- 食品行业SCM供应链管理平台促进供需协同,赋能产业发展
- 2022主流技术 Appium+IOS 自动化测试环境搭建
- mysql源代码多少行_数据库是一个庞大的工程,本来想读读mysql的开源代码,可看到代码行数.doc...
- 建模常用Python代码
- python读取海康威视摄像头价格_OpenCV+海康威视摄像头的实时读取
- 三菱数控CNC系统G代码M代码大全
- 网件刷breed_斐讯K2刷不死breed加padavan华硕固件教程