Home >Backend Development >PHP Tutorial >thinkphp 如何实例化自定义的类

thinkphp 如何实例化自定义的类

WBOY
WBOYOriginal
2016-06-13 10:04:561643browse

thinkphp 怎么实例化自定义的类啊
要放在那个目录里面?命名有哪些规则?

------解决方案--------------------
目录:app/Lib/ORG
命名:XXX.class.php
实例:$x=new XXX();
------解决方案--------------------
你也可以设置自己的类文件自动加载搜索路径,在配置文件里面设置APP_AUTOLOAD_PATH的值。这个常量有个默认的路径Think.Util,多个好像使用逗号隔开

Statement:
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