Download the PHP package jaxon-php/jaxon-annotations without Composer
On this page you can find all versions of the php package jaxon-php/jaxon-annotations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jaxon-php/jaxon-annotations
More information about jaxon-php/jaxon-annotations
Files in jaxon-php/jaxon-annotations
Package jaxon-annotations
Short Description Annotations support for the Jaxon ajax PHP library
License BSD-3-Clause
Homepage https://www.jaxon-php.org
Informations about the package jaxon-annotations
Annotations for the Jaxon library
This package provides annotation support for the Jaxon library. The configuration options that are related to Jaxon classes can be set directly in the class files using annotations.
Two different syntax are allowed for annotations: the default array-like syntax, and an alternative docblock-like syntax,
available since version 1.4
.
Installation
Install this package with composer
.
It requires jaxon-php/jaxon-core
v4 or higher.
Set the annotation config option to on.
Usage
The following annotations are provided.
@exclude
It prevents a method or a class from being exported to javascript. It takes an optional boolean parameter.
The PHP-DOC syntax can also be used.
@upload
It adds file upload to an ajax request. It takes the id of the HTML field as a mandatory option. It applies only to methods.
The PHP-DOC syntax can also be used.
@before
It defines a method of the class as a callback to be called before processing the request. It takes the name of the method as a mandatory parameter, and an array as optional parameters to be passed to the callback. It applies to methods and classes.
The PHP-DOC syntax can also be used.
@after
It defines a method of the class as a callback to be called after processing the request. It takes the name of the method as a mandatory parameter, and an array as optional parameters to be passed to the callback. It applies to methods and classes.
The PHP-DOC syntax can also be used.
@callback
It defines a javascript object to be used as callback when processing the ajax request.
It was added in version 2.2.0.
The PHP-DOC syntax can also be used.
@databag
It defines a data bag to be appended to ajax requests to a method. It takes the name of the data bag as a mandatory parameter. It applies to methods and classes.
The PHP-DOC syntax can also be used.
@di
It defines an attribute that will be injected in a class.
When applied on methods and classes, it takes the name and the class of the attribute as parameters.
The class parameter is optional, and can be omitted if it is already specified by a @var
annotation.
When applied on attributes, it takes the class of the attribute as only parameter, which can be omitted if it is already specified by a @var
annotation.
If the class name does not start with a "\"
, then the corresponding fully qualified name (FQN) will be set using
either the use
instructions or the namespace
in its source file.
The PHP-DOC syntax can also be used.