Home >Backend Development >PHP Tutorial >thinkPHP simply calls functions and class libraries

thinkPHP simply calls functions and class libraries

WBOY
WBOYOriginal
2018-04-08 09:59:121744browse

Function call:

lib public function library is called common.php

App/common/common.php

The public function library under the grouping module is called function.php

App/Modules/Admin/common/function.php

Class library call:

class IndexAction extends Action{
public function index(){
// Call "Extended Base Class Library" ThinkPHP/Extend/Library/ORG/Util/Test.class.php
import('ORG.Util.Test');
$test = new Test();
// Call "Extended Base Class Library" ThinkPHP/Extend/Library/Com/Util/Test.class.php
import('Com.Util.Test');
$test = new Test() ;
// Call "Core Base Class Library" ThinkPHP/Lib/Core/Test.class.php
import('Think.Core.Test');
$test = new Test();
$this->display();
}
}


The above is the detailed content of thinkPHP simply calls functions and class libraries. For more information, please follow other related articles on the PHP Chinese website!

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