Class lispa\amos\core\components\ImageUtility
Inheritance | lispa\amos\core\components\ImageUtility » yii\base\Component » yii\base\Object |
---|---|
Implements | yii\base\Configurable |
All the utilities methods about the images
Add the components in the file configuration common/config/main.php
'components' => [
//...
'imageUtility' => [
'class' => 'lispa\amos\core\components\ImageUtility',
],
//...
]
/...
Can use it in this mode
`
php
//The $model that have the method getAvatarUrl or similar (getAvatarUrl have to return an image's URL)
Yii::$app->imageUtility->getRoundImage($model)
`
Public Properties
Public Methods
Method | Description | Defined By |
---|---|---|
__call() | Calls the named method which is not a class method. | yii\base\Component |
__clone() | This method is called after the object is created by cloning an existing one. | yii\base\Component |
__construct() | Constructor. | yii\base\Object |
__get() | Returns the value of a component property. | yii\base\Component |
__isset() | Checks if a property is set, i.e. defined and not null. | yii\base\Component |
__set() | Sets the value of a component property. | yii\base\Component |
__unset() | Sets a component property to be null. | yii\base\Component |
attachBehavior() | Attaches a behavior to this component. | yii\base\Component |
attachBehaviors() | Attaches a list of behaviors to the component. | yii\base\Component |
behaviors() | Returns a list of behaviors that this component should behave as. | yii\base\Component |
canGetProperty() | Returns a value indicating whether a property can be read. | yii\base\Component |
canSetProperty() | Returns a value indicating whether a property can be set. | yii\base\Component |
className() | Returns the fully qualified name of this class. | yii\base\Object |
detachBehavior() | Detaches a behavior from the component. | yii\base\Component |
detachBehaviors() | Detaches all behaviors from the component. | yii\base\Component |
ensureBehaviors() | Makes sure that the behaviors declared in behaviors() are attached to this component. | yii\base\Component |
getBehavior() | Returns the named behavior object. | yii\base\Component |
getBehaviors() | Returns all behaviors attached to this component. | yii\base\Component |
getHorizontalImage() | This method return the attributes (class, margin-top and margin-left) of the $model's image - used for HORIZONTAL CONTAINER | lispa\amos\core\components\ImageUtility |
getRoundImage() | This method return the attributes (class, margin-top and margin-left) of the $model's image | lispa\amos\core\components\ImageUtility |
getRoundRelativeImage() | This method return the attributes class of the $model's image | lispa\amos\core\components\ImageUtility |
hasEventHandlers() | Returns a value indicating whether there is any handler attached to the named event. | yii\base\Component |
hasMethod() | Returns a value indicating whether a method is defined. | yii\base\Component |
hasProperty() | Returns a value indicating whether a property is defined for this component. | yii\base\Component |
init() | Initializes the object. | yii\base\Object |
off() | Detaches an existing event handler from this component. | yii\base\Component |
on() | Attaches an event handler to an event. | yii\base\Component |
trigger() | Triggers an event. | yii\base\Component |
Property Details
Method Details
This method return the attributes (class, margin-top and margin-left) of the $model's image - used for HORIZONTAL CONTAINER
public array getHorizontalImage ( $model ) | ||
$model | object | Object that have the method getAvatarUrl or similar (getAvatarUrl have to return an image's URL) |
return | array | The array with the value of class, margin-left and margin-top |
---|
This method return the attributes (class, margin-top and margin-left) of the $model's image
public array getRoundImage ( $model ) | ||
$model | object | Object that have the method getAvatarUrl or similar (getAvatarUrl have to return an image's URL) |
return | array | The array with the value of class, margin-left and margin-top |
---|
This method return the attributes class of the $model's image
public array getRoundRelativeImage ( $model ) | ||
$model | object | Object that have the method getAvatarUrl or similar (getAvatarUrl have to return an image's URL) |
return | array | The array with the value of class |
---|