Download the PHP package sorry510/annotation without Composer

On this page you can find all versions of the php package sorry510/annotation. 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 annotation

安装

使用说明

功能

添加了 4 中注解

使用前提

@Validator

Validator(class, scene)有 2 个参数 classscene,

当验证没有通过时,会抛出异常被捕获,直接返回

Validate 类的写法

示例

@RequestParam

RequestParam(fields, method)有 2 个参数 fieldsmethod,

示例

ps: 注意默认是数组的写法是用 {} 而不是 [] , 字符串必须用 " , 不能用'

@Transaction

示例

ps: 事务对http的返回code码为200~300之间的自动提交,其它的进行回滚操作

@Inject

Inject(args)有 1 个参数 args,

在注释中添加 @var xxxclass 注释想要被注入的类即可实现注入,注入为循环模式,最多 2 层深度,相当于可以在 controller 层注入任意的类, 同时在这个任意的类注入另一些类,当被注入的类有构造函数 __contruct 时,会依据构造函数实例化,构造函数中含有的实体类参数也会被自动注入,非实体类参数可以通过 args 传参传入(非实体类参数必须放到实体类参数后面)

完整示例

controller 层注入

循环注入属性,有如下 2 中方式


All versions of annotation with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
ext-json Version *
doctrine/annotations Version ^1.12
php-di/phpdoc-reader Version ^2.2
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 sorry510/annotation contains the following files

Loading the files please wait ....