Exemplo n.º 1
0
?>

    <?php 
echo $form->field($model, 'englishname')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'acronym')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'exchid')->dropDownList(DatabaseHelper::getExchangesList(), ['prompt' => 'Select exchange']);
?>

    <?php 
echo $form->field($model, 'companyid')->dropDownList(DatabaseHelper::getCompaniesList(), ['prompt' => 'Select company']);
?>

    <?php 
echo $form->field($model, 'privileged')->checkbox();
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>
Exemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['fullname', 'shortname', 'englishname', 'acronym', 'exchid', 'companyid'], 'required'], ['exchid', 'in', 'range' => array_keys(DatabaseHelper::getExchangesList())], ['companyid', 'in', 'range' => array_keys(DatabaseHelper::getCompaniesList())], ['ActiveFlag', 'integer'], ['ChangeDate', 'safe'], [['fullname', 'shortname', 'englishname', 'acronym'], 'string', 'max' => 255], ['privileged', 'boolean']];
 }