Class ekstazi\crud\actions\ViewAction

Inheritanceekstazi\crud\actions\ViewAction » ekstazi\crud\actions\Action » yii\base\Action

View model action

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$checkAccess callable A PHP callable that will be called when running an action to determine if the current user has the permission to execute the action. ekstazi\crud\actions\Action
$findModel callable A PHP callable that will be called to return the model corresponding to the specified primary key value. ekstazi\crud\actions\ViewAction
$modelClass string Class name of the model which will be handled by this action. ekstazi\crud\actions\Action
$viewName string View file name ekstazi\crud\actions\ViewAction

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
ensureAccess() Ensure this action is allowed for current user ekstazi\crud\actions\Action
findModel() Find model by its pk from params otherwise the not found exception will be thrown ekstazi\crud\actions\Action
findModelByPk() Extract pk from params and find model ekstazi\crud\actions\Action
redirect() Redirect to route passed as param ekstazi\crud\actions\Action
saveModel() ekstazi\crud\actions\Action

Property Details

$findModel public property

A PHP callable that will be called to return the model corresponding to the specified primary key value. If not set, findModelByPk() will be used instead. The signature of the callable should be:

function ($params) {
    
// $params is the params from request
}

The callable should return the model found. Otherwise the not found exception will be thrown.

$viewName public property
string $viewName 'view'

View file name

Method Details

run() public method

void run( )
throws \yii\web\BadRequestHttpException
throws \yii\web\NotFoundHttpException