Initial commit
This commit is contained in:
49
frontend/views/meal/index.php
Normal file
49
frontend/views/meal/index.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use common\models\Meal;
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
use yii\grid\ActionColumn;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var yii\data\ActiveDataProvider $dataProvider */
|
||||
|
||||
$this->title = 'Meals';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="meal-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Create Meal', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'id',
|
||||
'file_name',
|
||||
'calories',
|
||||
'protein',
|
||||
'fat',
|
||||
//'carbohydrates',
|
||||
//'fiber',
|
||||
//'meal',
|
||||
//'created_at',
|
||||
//'updated_at',
|
||||
[
|
||||
'class' => ActionColumn::className(),
|
||||
'urlCreator' => function ($action, Meal $model, $key, $index, $column) {
|
||||
return Url::toRoute([$action, 'id' => $model->id]);
|
||||
}
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user