/** * @return array */ public function rules() { return [['name', 'required'], ['name, color', 'filter', 'filter' => 'trim'], ['color', 'default', 'value' => null], ['color', 'in', 'range' => array_keys(OrderHelper::colorNames())], ['is_system', 'boolean'], ['id, name', 'safe', 'on' => 'search']]; }
echo Yii::t('OrderModule.order', 'are required'); ?> </div> <?php echo $form->errorSummary($model); ?> <div class="row"> <div class="col-sm-4"> <?php echo $form->textFieldGroup($model, 'name'); ?> </div> <div class="col-sm-1"> <?php echo $form->dropDownListGroup($model, 'color', ['widgetOptions' => ['data' => OrderHelper::colorNames(), 'htmlOptions' => ['empty' => '', 'id' => 'colorselector', 'options' => OrderHelper::colorValues()]]]); ?> </div> </div> <?php $this->widget('bootstrap.widgets.TbButton', ['buttonType' => 'submit', 'context' => 'primary', 'label' => $model->getIsNewRecord() ? Yii::t('OrderModule.order', 'Add status and continue') : Yii::t('OrderModule.order', 'Save status and continue')]); ?> <?php $this->widget('bootstrap.widgets.TbButton', ['buttonType' => 'submit', 'htmlOptions' => ['name' => 'submit-type', 'value' => 'index'], 'label' => $model->getIsNewRecord() ? Yii::t('OrderModule.order', 'Add status and close') : Yii::t('OrderModule.order', 'Save status and close')]); ?> <?php $this->endWidget();