Download the PHP package consik/yii2-fluent without Composer
On this page you can find all versions of the php package consik/yii2-fluent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-fluent
Yii2 Fluent Component Behavior
Behavior that implements fluent interface methods for component attributes.
Installation
The preferred way to install this extension is through composer.
Either run
or add
FluentComponentBehavior class description
Properties
Associative or simple array of attributes that can be changed using fluent interface.
For associative definition key
is alias for attributes methods;
Value is always component attribute name;
Defines need bahavior to initialize property as array if it's empty and !is_array() when calling array-access fluent methods(like )
Public methods
Universal fluent methods for owner component
Sets value to component property
Unsets component property
Adds to array property with name ;
Throws exception if is ;
initializes as empty array if ;
Examples
Short definition of behavior. Behavior will implement all available fluent methods for ALL component attributes
Available fluent methods for this definition:
- (new Test())
- ->setProperty($name, $value)
- ->unsetProperty($name)
- ->addItemTo($arrName, $arrayItem)
- ->setIsNew($value)
- ->unsetIsNew()
- ->addIsNew($arrayItem)
- ->setComments($value)
- ->unsetComments()
- ->addComments($arrayItem)
Extended definition of behavior, for enumerated properties, with alias for one of property.
Available fluent methods for this definition:
- (new Test())
- ->setProperty($name, $value)
- ->unsetProperty($name)
- ->addItemTo($arrName, $arrayItem)
- ->setNew($value)
- ->unsetNew()
- ->addNew($arrayItem)
- ->setComments($value)
- ->unsetComments()
- ->addComments($arrayItem)
Be helpful!
Don't forget about other developers and write comments for your classes!
Basic comment for all components with attached FluentInterfaceBehavior
And, please, don't forget writing comments about defined fluent methods for your component properties!!!
Best regards, Sergey Poltaranin.