Home > Backend Development > PHP Tutorial > phpcms中如何实例化呢

phpcms中如何实例化呢

WBOY
Release: 2016-06-23 13:41:37
Original
885 people have browsed it

想调用类中的一个方法
俺也知道开始要实例化类,
但怎么写呢


回复讨论(解决方案)

模型类:pc_base::load_model()
系统类库:pc_base::load_sys_class()
模块类库:pc_base::load_app_class()

#file: phpcms/base.php#line: 110private static function _load_class($classname, $path = '', $initialize = 1) {}
Copy after login
Copy after login

模型类:pc_base::load_model()
系统类库:pc_base::load_sys_class()
模块类库:pc_base::load_app_class()

#file: phpcms/base.php#line: 110private static function _load_class($classname, $path = '', $initialize = 1) {}
Copy after login
Copy after login


还有一个问题
为啥我在自定义函数类中写了一个测试函数
<?php/** *  extention.func.php 用户自定义函数库 * * @copyright			(C) 2005-2010 PHPCMS * @license				http://www.phpcms.cn/license/ * @lastmodify			2010-10-27 */ //获取评论总数 //测试函数function getTest($id){    echo "159111111111111111111111111111111111";}?>
Copy after login


然后我在前台模板中写上
{template "content","header"}

{getTest(aaa)}
但是没有输出呢

呵呵,没有刷新.给你加分

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template