run() public method

Displays a model.
public run ( string $id ) : yii\db\ActiveRecordInterface
$id string the primary key of the model.
return yii\db\ActiveRecordInterface the model being displayed
コード例 #1
0
 public function run($id)
 {
     $model = parent::run($id);
     foreach ($this->controller->getFilters() as $column => $value) {
         if ($model->{$column} != $value) {
             throw new NotFoundHttpException("Object not found: {$id}");
         }
     }
     return $model;
 }
コード例 #2
0
ファイル: ViewAction.php プロジェクト: timelessmemory/uhkklp
 public function run($id)
 {
     return parent::run($id);
 }
コード例 #3
0
ファイル: CurrentAction.php プロジェクト: gbksoft/yii2-tokens
 /**
  * @inheritdoc
  */
 public function run()
 {
     return parent::run(null);
 }