时间:2021-05-26
本文实例讲述了php封装的smartyBC类。分享给大家供大家参考,具体如下:
<?php/** * Project: Smarty: the PHP compiling template engine * File: SmartyBC.class.php * SVN: $Id: $ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * For questions, help, comments, discussion, etc., please join the * Smarty mailing list. Send a blank e-mail to * smarty-discussion-subscribe@googlegroups.com * * @link http://pile_id, $exp_time); } /** * Checks whether requested template exists. * * @param string $tpl_file * * @return boolean */ public function template_exists($tpl_file) { return $this->templateExists($tpl_file); } /** * Returns an array containing template variables * * @param string $name * * @return array */ public function get_template_vars($name = null) { return $this->getTemplateVars($name); } /** * Returns an array containing config variables * * @param string $name * * @return array */ public function get_config_vars($name = null) { return $this->getConfigVars($name); } /** * load configuration values * * @param string $file * @param string $section * @param string $scope */ public function config_load($file, $section = null, $scope = 'global') { $this->ConfigLoad($file, $section, $scope); } /** * return a reference to a registered object * * @param string $name * * @return object */ public function get_registered_object($name) { return $this->getRegisteredObject($name); } /** * clear configuration values * * @param string $var */ public function clear_config($var = null) { $this->clearConfig($var); } /** * trigger Smarty error * * @param string $error_msg * @param integer $error_type */ public function trigger_error($error_msg, $error_type = E_USER_WARNING) { trigger_error("Smarty error: $error_msg", $error_type); }}/** * Smarty {php}{/php} block function * * @param array $params parameter list * @param string $content contents of the block * @param object $template template object * @param boolean &$repeat repeat flag * * @return string content re-formatted */function smarty_php_tag($params, $content, $template, &$repeat){ eval($content); return '';}更多关于Smarty相关内容感兴趣的读者可查看本站专题:《smarty模板入门基础教程》、《PHP模板技术总结》、《PHP基于pdo操作数据库技巧总结》、《PHP运算与运算符用法总结》、《PHP网络编程技巧总结》、《PHP基本语法入门教程》、《php面向对象程序设计入门教程》、《php字符串(string)用法总结》、《php+mysql数据库操作入门教程》及《php常见数据库操作技巧汇总》
希望本文所述对大家基于smarty模板的PHP程序设计有所帮助。
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
本文实例讲述了PHP封装的完整分页类。分享给大家供大家参考,具体如下:total=$_total?$_total:1;//总条数$this->pages
本文实例讲述了PHP封装的HttpClient类。分享给大家供大家参考。具体分析如下:这是一段php封装的HttpClient类,可实现GETPOSTCooki
本文实例讲述了PHP封装的XML简单操作类。分享给大家供大家参考,具体如下:xml_dom.php封装类文件:dbfile=$db_file;if(!file_
本文实例讲述了php封装的mysqli类。分享给大家供大家参考,具体如下:类:?1234567891011121314151617181920212223242
本文实例讲述了PHP封装的简单连接MongoDB类。分享给大家供大家参考,具体如下:1.封装MongoDB类mongo=newMongoClient("mong