Beispiel #1
0
    <?php 
$box->beginBody();
?>
        <?php 
echo $form->field($model, 'description')->textInput();
?>
        <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => 64]);
?>
        <?php 
echo $form->field($model, 'childRoles')->dropDownList($model->getChildRolesValues(), ['multiple' => 'multiple', 'size' => 10]);
?>
        <?php 
echo $form->field($model, 'childPermissions')->dropDownList($model->getChildPermissionsValues(), ['multiple' => 'multiple', 'size' => 20]);
?>

    <?php 
$box->endBody();
?>

    <?php 
$box->actions([AdminHtml::actionButton(AdminHtml::ACTION_SAVE_AND_STAY, $model->isNewRecord), AdminHtml::actionButton(AdminHtml::ACTION_SAVE_AND_LEAVE, $model->isNewRecord), AdminHtml::actionButton(AdminHtml::ACTION_SAVE_AND_CREATE, $model->isNewRecord)]);
?>

    <?php 
ActiveForm::end();
?>

<?php 
FormBox::end();
Beispiel #2
0
        <?php 
echo $form->field($model, 'subject')->textInput(['maxlength' => 255]);
?>
        <?php 
echo $form->field($model, 'body_html')->tinyMce(['rows' => 6]);
?>
    </div>
</div>


<?php 
$box->endBody();
?>

<?php 
$box->actions([\yii\helpers\Html::submitButton($model->isNewRecord ? Yii::t('admin/mailer', 'Create & Send!') : Yii::t('admin/mailer', 'Save & Send!'), ['class' => 'btn btn-success btn-lg', 'name' => AdminHtml::ACTION_BUTTON_NAME, 'value' => MailsController::ACTION_SEND_MAIL]), AdminHtml::actionButton(AdminHtml::ACTION_SAVE_AND_STAY, $model->isNewRecord), AdminHtml::actionButton(AdminHtml::ACTION_SAVE_AND_LEAVE, $model->isNewRecord), AdminHtml::actionButton(AdminHtml::ACTION_SAVE_AND_CREATE, $model->isNewRecord)]);
ActiveForm::end();
?>

<?php 
FormBox::end();
$id = \yii\helpers\Html::getInputId($model, 'receiversProviderAttribute');
$actionName = AdminHtml::ACTION_BUTTON_NAME;
$actionValue = MailsController::ACTION_CHANGE_RECEIVERS_PROVIDER;
$js = <<<JS
(function() {
    \$('#{$id}').on('change', function() {
        var _form = \$('#{$form->id}');
        _form.append(\$('<input type="hidden">').attr('name', '{$actionName}').val('{$actionValue}'));
        _form.data('yiiActiveForm').validated = true;
        _form.submit();