Download the PHP package yfcmf/tp5-addons without Composer

On this page you can find all versions of the php package yfcmf/tp5-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 tp5-addons

tp5-addons

The ThinkPHP5 Addons Package

安装

composer require yfcmf/tp5-addons

配置

公共配置

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

创建插件

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

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

下面写一个例子:

创建test插件

在addons目录中创建test目录

创建钩子实现类

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

创建插件配置文件

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

创建钩子模板文件

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

创建插件的controller文件

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

如果需要使用view模板则需要继承\think\addons\Base类 模板文件所在位置为插件目录的view中,规则与模块中的view规则一致

使用钩子

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

模板中使用钩子

php业务中使用

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


All versions of tp5-addons with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
topthink/think-helper Version >=1.0.4
topthink/think-installer Version >=1.0.10
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 yfcmf/tp5-addons contains the following files

Loading the files please wait ....