Download the PHP package cafelatte/php-vast without Composer
On this page you can find all versions of the php package cafelatte/php-vast. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cafelatte/php-vast
More information about cafelatte/php-vast
Files in cafelatte/php-vast
Package php-vast
Short Description Generator and parser for VAST documents
License MIT
Informations about the package php-vast
PHP-VAST
:star: VAST Ad generator and parser library on PHP.
Specs
- VAST 2.0 Spec: http://www.iab.net/media/file/VAST-2_0-FINAL.pdf
- VAST 3.0 Spec: http://www.iab.com/wp-content/uploads/2015/06/VASTv3_0.pdf
- VAST 4.0 Spec:
- VAST 4.1 Spec:
- VAST Samples
Install
Install library through composer:
Quick start
This will generate:
Custom Specification Support
VAST document elements are completely described in it's specification, but some Ad servers may add support for custom elements and attributes. This library strictly follows specification, generally because two dialects of VAST may conflict with each other. You may write our own dialect by overriding element builder and create any elements and attributes you want.
The VAST dialect is described in \Sokil\Vast\ElementBuilder
class. By overriding it you may create instances of your own classes and add there any setters.
First let's create a class for MediaFile
and add some custom attributes:
Now we need to override the default element builder and create our own MediaFile
factory method:
Now we need to confugure VAST factory to use overridden element builder:
If you have an AD server and want to add support for your custom tag, create your own library with custom elements and element builder, or add a pull request to this library.
All versions of php-vast with dependencies
ext-dom Version *
ext-json Version *