/**
  * Lists all HostsAverageWeekdays models.
  * @return mixed
  */
 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => HostsAverageWeekdays::find()]);
     return $this->render('index', ['dataProvider' => $dataProvider]);
 }
Esempio 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]);
    ?>