PHP Class dosamigos\fileupload\actions\FileDeleteAction

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 delete
$idParamName the parameter name in the request. Defaults to 'id'.
$ownerLinkTable the name of the table handling relations -ie city_picture_assn
$ownerLinkTableAttribute the name of the attribute of the class we are going to delete -ie picture_id
$redirectRoute the route to redirect after successful deletion. Note: If the user is doing and AJAX'ed request. Will simply return a JSON with success true or false. If success it will contain a message, otherwise will contain also errors key so you can display the issues on a notification plugin or whatever.

Public Methods

Method Description
init ( )
run ( ) : array | Response

Protected Methods

Method Description
getModelErrors ( Model $model ) : array Helper function
unlink ( mixed $id ) Removed

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 | Response
return array | yii\web\Response

Property Details

$className public_oe property

the AR class name that we need to delete
public $className

$idParamName public_oe property

the parameter name in the request. Defaults to 'id'.
public $idParamName

$ownerLinkTable public_oe property

the name of the table handling relations -ie city_picture_assn
public $ownerLinkTable

$ownerLinkTableAttribute public_oe property

the name of the attribute of the class we are going to delete -ie picture_id
public $ownerLinkTableAttribute

$redirectRoute public_oe property

the route to redirect after successful deletion. Note: If the user is doing and AJAX'ed request. Will simply return a JSON with success true or false. If success it will contain a message, otherwise will contain also errors key so you can display the issues on a notification plugin or whatever.
public $redirectRoute