Tag:thinkphp
-
Time:2021-1-15
This paper introduces the operation of reading excel and importing database realized by ThinkPHP framework. The details are as follows: In the entry file: require_once VENDOR_PATH.’PHPExcel/PHPExcel/IOFactory.php’; require_once VENDOR_PATH.’PHPExcel/PHPExcel.php’; PHP: namespace Home\Controller; class ExcelController extends CommonController { public function Import() { // vendor(‘PHPExcel.PHPExcel.IOFactory’); vendor(“PHPExcel.PHPExcel.PHPExcel”); vendor(“PHPExcel.PHPExcel.Writer.Excel5”); vendor(“PHPExcel.PHPExcel.Writer.Excel2007”); //$excel = new PHPExcel(); $fileName = ‘./trans_rate.xlsx’; date_default_timezone_set(‘PRC’); //Read excel […]
-
Time:2021-1-7
preface Thinkphp3.1.2 needs to use the CLI method to run the scriptIt took a day to get it doneVersion 3.1.2 is really old solve increase cli.php Entry file define (‘APP_NAME’,’App’); define (‘APP_PATH’,’./App/’); define(‘APP_DEBUG’, true); define(‘MODE_NAME’,’cli’); require ‘./Base/ThinkPHP.php’; Note the name of the directory: change it according to the actual situation cli.php Add parsing module, method […]
-
Time:2020-12-20
This paper introduces the extension of ThinkPHP class library. For your reference, the details are as follows: Class library extension The class library of ThinkPHP mainly includes public class library and application class library, which are defined and extended based on the namespace. As long as it is defined according to the specification, it can […]
-
Time:2020-12-19
This paper describes the common methods of database driven extension of ThinkPHP framework. For your reference, the details are as follows: Database driven The default database driver is under the think / db / driver namespace. The driver class must inherit the think / DB class. The interface methods that each database driver must implement […]
-
Time:2020-12-18
This paper describes the principle and usage of tag library driver of ThinkPHP framework extension. For your reference, the details are as follows: stayThink\TemplateThe bid winning database is embodied in the way of XML namespace. Each tag library corresponds to a tag library driver class, and each driver class is responsible for parsing all tags […]
-
Time:2020-12-17
This paper describes the behavior extension principle and implementation method of ThinkPHP framework extension. For your reference, the details are as follows: The tag positions provided by the system core include the following (in order of execution) app_init Application initialization tag bit path_info PATH_ Info detect tag bit app_begin Application start tag bit action_name Operation […]
-
Time:2020-12-16
This paper describes the implementation method of widget extension of ThinkPHP framework extension. For your reference, the details are as follows: Widget extension Widget extension is generally used to extend page components. For example, we implement a classified widget in the page. First, we need to define a widget controller layer, catewidget, as follows: namespace […]
-
Time:2020-12-5
This paper describes the implementation method of application pattern of ThinkPHP framework extension. For your reference, the details are as follows: Application mode Application mode is your living environment, development environment and execution environment. It is just like the application scenario (pattern) of a framework, which platform the framework runs on, There are three modes […]
-
Time:2020-12-4
This article describes the driver extension of ThinkPHP framework extension. For your reference, the details are as follows: Each class library can design its own driver. Therefore, the driver directory of version 3.2 is not independent, but placed under the namespace of each class library. For example:Think\LogClass driverThink\Log\Driver Under the namespace,Think\DbClass driverThink\Db\Driver Under the namespace. […]
-
Time:2020-12-2
This paper describes the source code acquisition, environment requirements and directory structure of ThinkPHP framework. For your reference, the details are as follows: Get ThinkPHP There are many ways to get ThinkPHP, official website( http://thinkphp.cn )It is the best source of download and document. The official website provides a stable version of the download: http://thinkphp.cn/down/framework.html […]
-
Time:2020-12-1
This paper introduces the function, definition and usage of the entry file of ThinkPHP framework. For your reference, the details are as follows: Entry file ThinkPHP adopts a single entry mode for project deployment and access. No matter what functions are completed, an application has a unified (but not necessarily the only) entrance. It should […]
-
Time:2020-10-25
This article describes the configuration loading and reading configuration of ThinkPHP framework configuration operation. For your reference, the details are as follows: Configuration loading In ThinkPHP, generally speaking, application configuration files are loaded automatically. The loading order is as follows: Convention configuration > application configuration > mode configuration > debugging configuration > state configuration > […]