thinkPHP simply calls functions and class libraries

WBOY
Release: 2023-03-23 09:20:02
Original
1680 people have browsed it

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!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!