Example #1
0
?>

<div style="margin-bottom: 5px">
    <table width="100%">
        <tbody>
            <tr>  
                <td>
                    <span class="pg-title" >Produtos</span>
                </td>
                <td>    
                    <?php 
echo Html::a('Adicionar', ['create'], ['class' => 'btn btn-success pull-right']);
?>
   
                </td>
            </tr>
        </tbody>
    </table>
</div>

<div class="User-default-index">
   
   <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $search, 'layout' => '{items}{pager}', 'columns' => ['id', 'reference', 'description', 'price', 'stock', ['attribute' => 'status', 'format' => 'text', 'content' => function ($data) {
    return \common\enum\ProductStatus::toName($data->status);
}], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}']]]);
?>
    
</div>

Example #2
0
    <?php 
echo $form->field($model, 'description');
?>
 
    <?php 
echo $form->field($model, 'family_id')->dropDownList($model->tableProductFamily);
?>
     
    <?php 
echo $form->field($model, 'price');
?>
    <?php 
echo $form->field($model, 'stock')->textInput()->hint('Ex: -1=Indisponível; 0=Disponível; n=Disponível em n horas');
?>
    <?php 
echo $form->field($model, 'status')->dropDownList(\common\enum\ProductStatus::getList());
?>
  
    
    <div class="form-group">
        <div class="col-sm-offset-3 col-sm-10">
            <?php 
echo Html::submitButton('Salvar', ['class' => 'btn btn-primary']);
?>
 
            <?php 
echo Html::a('Voltar', ['index'], ['class' => 'btn btn-info']);
?>
 
        </div>
    </div>