run() public méthode

Displays a model.
public run ( string $id ) : yii\db\ActiveRecordInterface
$id string the primary key of the model.
Résultat yii\db\ActiveRecordInterface the model being displayed
 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;
 }
Exemple #2
0
 public function run($id)
 {
     return parent::run($id);
 }
 /**
  * @inheritdoc
  */
 public function run()
 {
     return parent::run(null);
 }