Home > Article > Backend Development > thinkPHP simply calls functions and class libraries
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!