/** * Finds the Line model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Line the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Line::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
public function actionIndex() { $product = Product::findOne(6); $line = Line::findOne(3); return $this->render('index', ['product' => $product, 'line' => $line]); }
</h1> <span><?php echo $line->description; ?> </span> </div> </div> <!-- <a href="#" class="flecha-l"><img src="<?php echo URL::base(); ?> /images/flecha-seccL.svg" alt="flecha"/></a> --> </section> <?php if (Yii::$app->getRequest()->getCookies()->has('line')) { $line_id = Yii::$app->getRequest()->getCookies()->getValue('line'); $line_i = Line::findOne($line_id); ?> <section class="sect-productos"> <div id="secc-edredones"> <img src="<?php echo URL::base(); ?> /images/<?php echo $line_i->picture; ?> "/> <a href="<?php echo URl::to(['line/view', 'id' => $line_i->id, '#' => $line->description]); ?> "><div class="btn-comprar2">Comprar</div></a> <div class="txt-secciones background-edredones">