Download the PHP package yuanmogu/think-addons without Composer
On this page you can find all versions of the php package yuanmogu/think-addons. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download yuanmogu/think-addons
More information about yuanmogu/think-addons
Files in yuanmogu/think-addons
Download yuanmogu/think-addons
More information about yuanmogu/think-addons
Files in yuanmogu/think-addons
Vendor yuanmogu
Package think-addons
Short Description The ThinkPHP6 Addons Package for beicms
License MIT
Homepage https://www.beisoo.com/
Package think-addons
Short Description The ThinkPHP6 Addons Package for beicms
License MIT
Homepage https://www.beisoo.com/
Please rate this library. Is it a good library?
Informations about the package think-addons
think-addons
The ThinkPHP 6 Addons Package for beicms
安装
composer require yuanmogu/think-addons
创建插件
创建的插件可以在view视图中使用,也可以在php业务中使用
安装完成后访问系统时会在项目根目录生成名为addons
的目录,在该目录中创建需要的插件。
下面写一个例子:
创建demo插件
在addons目录中创建demo目录
创建钩子实现类
在demo目录中创建同名 Demo.php 类文件。注意:类文件首字母需大写
创建插件配置文件
在test目录中创建config.php类文件,插件配置文件可以省略。
创建钩子模板文件
在demo->view目录中创建info.html模板文件,钩子在使用fetch方法时对应的模板文件。
创建插件的controller文件
在test目录中创建controller目录,在controller目录中创建Index.php文件 controller类的用法与tp6中的controller一致
使用钩子
创建好插件后就可以在正常业务中使用该插件中的钩子了 使用钩子的时候第二个参数可以省略
模板中使用钩子
php业务中使用
只要是thinkphp6正常流程中的任意位置均可以使用
插件公共方法
All versions of think-addons with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.1.0
topthink/framework Version ^6.0
topthink/think-view Version ^1.0
topthink/think-helper Version ^3.0.0
topthink/framework Version ^6.0
topthink/think-view Version ^1.0
topthink/think-helper Version ^3.0.0
The package yuanmogu/think-addons contains the following files
Loading the files please wait ....