PHP Class dosamigos\fileupload\actions\AbstractUploadAction

OVERRIDE its "upload" function to implement your own.
Author: Antonio Ramirez ([email protected])
Inheritance: extends yii\base\Action
Datei anzeigen Open project: 2amigos/yii2-file-upload-widget

Public Properties

Property Type Description
$className the AR class name that we need to link the uploaded instance to
$deleteIdParamName the parameter name to pass to the delete Url route
$deleteUrlRoute the parameter name so to add the delete
$fileAttributeName the attribute name of the class that validates the uploaded files
$filePathAlias the path alias where to upload the files. -ie @frontend/web/files
$filesWebUrl the web url where they are stored. -ie http://myexample.com/files
$ownerIdParamName the parameter name where we can get the owner id. Defaults to 'ownerId'
$ownerLinkTable the owner table link -ie city_picture_assn
$ownerLinkTableAttribute the name of the attribute of the class we are going to upload and link -ie picture_id
$ownerLinkTableOwnerAttribute the owner's attribute in the table link -ie city_id
$thumbnailUrlAttributeName the attribute name of the class that will contain thumbnail's web url reference -ie thumbnail. Could also be url but then make sure the resize is correct.
$uploadAttributeName the attribute name the class is using to upload files
$urlAttributeName the attribute name of the class that will contain the web url reference -ie url

Public Methods

Method Description
init ( )
run ( ) : array

Protected Methods

Method Description
getModelErrors ( Model $model ) : array Helper function
link ( mixed $ownerId, mixed $id ) Links uploaded file to its owner.
upload ( ActiveRecord $model ) : mixed Handles files upload Override as needed.

Method Details

getModelErrors() protected method

Helper function
protected getModelErrors ( Model $model ) : array
$model yii\base\Model
return array

init() public method

public init ( )

run() public method

public run ( ) : array
return array

upload() protected method

Handles files upload Override as needed.
protected upload ( ActiveRecord $model ) : mixed
$model yii\db\ActiveRecord
return mixed

Property Details

$className public_oe property

the AR class name that we need to link the uploaded instance to
public $className

$deleteIdParamName public_oe property

the parameter name to pass to the delete Url route
public $deleteIdParamName

$deleteUrlRoute public_oe property

the parameter name so to add the delete
public $deleteUrlRoute

$fileAttributeName public_oe property

the attribute name of the class that validates the uploaded files
public $fileAttributeName

$filePathAlias public_oe property

the path alias where to upload the files. -ie @frontend/web/files
public $filePathAlias

$filesWebUrl public_oe property

the web url where they are stored. -ie http://myexample.com/files
public $filesWebUrl

$ownerIdParamName public_oe property

the parameter name where we can get the owner id. Defaults to 'ownerId'
public $ownerIdParamName

$ownerLinkTable public_oe property

the owner table link -ie city_picture_assn
public $ownerLinkTable

$ownerLinkTableAttribute public_oe property

the name of the attribute of the class we are going to upload and link -ie picture_id
public $ownerLinkTableAttribute

$ownerLinkTableOwnerAttribute public_oe property

the owner's attribute in the table link -ie city_id
public $ownerLinkTableOwnerAttribute

$thumbnailUrlAttributeName public_oe property

the attribute name of the class that will contain thumbnail's web url reference -ie thumbnail. Could also be url but then make sure the resize is correct.
public $thumbnailUrlAttributeName

$uploadAttributeName public_oe property

the attribute name the class is using to upload files
public $uploadAttributeName

$urlAttributeName public_oe property

the attribute name of the class that will contain the web url reference -ie url
public $urlAttributeName