Download the PHP package nickbai/pfecms-think-addons without Composer

On this page you can find all versions of the php package nickbai/pfecms-think-addons. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pfecms-think-addons

think-addons

The ThinkPHP 6 Addons Package for PFECMS

安装

composer require nickbai/pfecms-think-addons

配置

生成配置

系统安装后会自动在 config 目录中生成 addons.php 的配置文件, 如果系统未生成可在命令行执行

快速生成配置文件

公共配置

或者在\config目录中新建addons.php,内容为:

创建插件

创建的插件可以在view视图中使用,也可以在php业务中使用

安装完成后访问系统时会在项目根目录生成名为addons的目录,在该目录中创建需要的插件。

下面写一个例子:

创建test插件

在addons目录中创建test目录

创建钩子实现类

在test目录中创建 Plugin.php 类文件。注意:类文件首字母需大写

创建插件配置文件

在test目录中创建config.php类文件,插件配置文件可以省略。

创建钩子模板文件

在test->view目录中创建info.html模板文件,钩子在使用fetch方法时对应的模板文件。

创建插件的controller文件

在test目录中创建controller目录,在controller目录中创建Index.php文件 controller类的用法与tp6中的controller一致

使用钩子

创建好插件后就可以在正常业务中使用该插件中的钩子了 使用钩子的时候第二个参数可以省略

模板中使用钩子

php业务中使用

只要是thinkphp6正常流程中的任意位置均可以使用

插件公共方法

插件目录结构

最终生成的目录结构为


All versions of pfecms-think-addons with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
topthink/framework Version ^6.0.3
topthink/think-view Version ^1.0
topthink/think-helper Version ^3.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nickbai/pfecms-think-addons contains the following files

Loading the files please wait ....