?> <div class="row"> <div class="col-xs-8"> <div class="portfolio-update"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php echo $this->render('_form', ['model' => $model]); ?> </div> </div> <div class="col-xs-4"> <div class="portfolio-update"> <div id="portfolio"> <!-- Пример отображения --> <?php echo $this->render('../../../frontend/views/landing/index/_portfolio', ['model' => Portfolio::findOne($model->id)]); ?> </div> </div> </div> </div> <?php \yii\widgets\Pjax::end();
/** * Finds the Portfolio model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Portfolio the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Portfolio::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }