Yii的smarty插件 ESmartyViewRenderer 中的错误更正
class ESmartyViewRenderer extends CApplicationComponent implements IViewRenderer { 省略.................. public function renderFile($context,$sourceFile,$data,$return) { // current controller properties will be accessible as {$this.property} $data['this'] = $context; // Yii::app()->... is available as {Yii->...} (deprecated, use {Yii::app()->...} instead, Smarty3 supports this.) $data['Yii'] = Yii::app(); // time and memory information $data['TIME'] = sprintf('%0.5f',Yii::getLogger()->getExecutionTime()); $data['MEMORY'] = round(Yii::getLogger()->getMemoryUsage()/(1024*1024),2).' MB'; // check if view file exists if(!is_file($sourceFile) || ($file=realpath($sourceFile))===false) throw new CException(Yii::t('yiiext','View file "{file}" does not exist.', array('{file}'=>$sourceFile))); $template = $this->smarty->createTemplate($sourceFile, null, null, $data, false); //render or return if($return){ /* * 源代码错误! * return $template->fetch($sourceFile); * 正确的调用方法如下,当指定参数时,必须指定所有相关的参数 * return $this->smarty->fetch($sourceFile, null, null, $data, false); */ return $template->fetch(); // 所有参数均从 $template 对象继承 } else { /* * 源代码错误! * $template->display($sourceFile); * 正确的调用方法如下,当指定参数时,必须指定所有相关的参数 * $this->smarty->display($sourceFile, null, null, $data, false); */ $template->display(); // 所有参数均从 $template 对象继承 } } }
声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章
R.E.P.O.能量晶体解释及其做什么(黄色晶体)
3 周前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
3 周前By尊渡假赌尊渡假赌尊渡假赌
刺客信条阴影:贝壳谜语解决方案
2 周前ByDDD
R.E.P.O.如果您听不到任何人,如何修复音频
3 周前By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解锁Myrise中的所有内容
3 周前By尊渡假赌尊渡假赌尊渡假赌

热工具

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

SecLists
SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。

SublimeText3 英文版
推荐:为Win版本,支持代码提示!

Dreamweaver CS6
视觉化网页开发工具