/**
  * Finds the HostsAverageWeekdays model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return HostsAverageWeekdays the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = HostsAverageWeekdays::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Ejemplo n.º 2
0
echo $this->render('_form', ['model' => $model, 'host_id' => $host_id, 'type' => 'Learning']);
?>

        <?php 
if ($dataProviderLearnig->getCount() > 0) {
    ?>
            <div class="col-md-12">
                <?php 
    echo GridView::widget(['dataProvider' => $dataProviderLearnig, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'language', ['class' => 'yii\\grid\\ActionColumn']]]);
    ?>
            </div>
        <?php 
}
?>
        <?php 
$newmodel = HostsAverageWeekdays::find()->where(['host_id' => $host_id])->one();
?>
        <div class="col-md-12">
            <?php 
if (count($newmodel) != 1) {
    ?>
                <a href="<?php 
    echo Url::to(['hostsaverageweekdays/create?host_id=' . $host_id]);
    ?>
" class="btn btn-primary">Next</a>
            <?php 
} else {
    ?>
                <a href="<?php 
    echo Url::to(['hostsaverageweekdays/update?id=' . $newmodel->id]);
    ?>