- Full name: \rkit\filemanager\behaviors\FileBehavior
- Parent class:
Get relation
FileBehavior::fileRelation( string $attribute ): \ActiveQuery
Parameters:
Parameter | Type | Description |
---|---|---|
$attribute |
string | The attribute name |
Get file option
FileBehavior::fileOption( string $attribute, string $option, mixed $defaultValue = null ): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$attribute |
string | The attribute name |
$option |
string | Option name |
$defaultValue |
mixed | Default value |
Get file storage
FileBehavior::fileStorage( string $attribute ): \Flysystem
Parameters:
Parameter | Type | Description |
---|---|---|
$attribute |
string | The attribute name |
Get file path
FileBehavior::filePath( string $attribute, \yii\db\ActiveRecord $file = null ): string
Parameters:
Parameter | Type | Description |
---|---|---|
$attribute |
string | The attribute name |
$file |
\yii\db\ActiveRecord | Use this file model |
Return Value:
The file path
Get file url
FileBehavior::fileUrl( string $attribute, \yii\db\ActiveRecord $file = null ): string
Parameters:
Parameter | Type | Description |
---|---|---|
$attribute |
string | The attribute name |
$file |
\yii\db\ActiveRecord | Use this file model |
Return Value:
The file url
Get extra fields of file
FileBehavior::fileExtraFields( string $attribute ): array
Parameters:
Parameter | Type | Description |
---|---|---|
$attribute |
string | The attribute name |
Get files
FileBehavior::files( string $attribute ): array<mixed,\ActiveRecord>
Parameters:
Parameter | Type | Description |
---|---|---|
$attribute |
string | The attribute name |
Return Value:
The file models
Get the file
FileBehavior::file( string $attribute ): \ActiveRecord
Parameters:
Parameter | Type | Description |
---|---|---|
$attribute |
string | The attribute name |
Return Value:
The file model
Get rules
FileBehavior::fileRules( string $attribute, boolean $onlyCoreValidators = false ): array
Parameters:
Parameter | Type | Description |
---|---|---|
$attribute |
string | The attribute name |
$onlyCoreValidators |
boolean | Only core validators |
Get file state
FileBehavior::fileState( string $attribute ): array
Parameters:
Parameter | Type | Description |
---|---|---|
$attribute |
string | The attribute name |
Get the presets of the file for apply after upload
FileBehavior::filePresetAfterUpload( string $attribute ): array
Parameters:
Parameter | Type | Description |
---|---|---|
$attribute |
string | The attribute name |
Create a thumb and return url
FileBehavior::thumbUrl( string $attribute, string $preset, \yii\db\ActiveRecord $file = null ): string
Parameters:
Parameter | Type | Description |
---|---|---|
$attribute |
string | The attribute name |
$preset |
string | The preset name |
$file |
\yii\db\ActiveRecord | Use this file model |
Return Value:
The file url
Create a thumb and return full path
FileBehavior::thumbPath( string $attribute, string $preset, \yii\db\ActiveRecord $file = null ): string
Parameters:
Parameter | Type | Description |
---|---|---|
$attribute |
string | The attribute name |
$preset |
string | The preset name |
$file |
\yii\db\ActiveRecord | Use this file model |
Return Value:
The file path
Create a file
FileBehavior::createFile( string $attribute, string $path, string $name ): \ActiveRecord
Parameters:
Parameter | Type | Description |
---|---|---|
$attribute |
string | The attribute name |
$path |
string | The file path |
$name |
string | The file name |
Return Value:
The file model
This document was automatically generated from source code comments on 2016-11-03 using phpDocumentor and cvuorinen/phpdoc-markdown-public