<?php

use app\widgets\ActiveForm;
use app\widgets\Check;
/** @var $register app\forms\user\Register */
?>

<?php 
$form = ActiveForm::begin(['pjax' => true, 'enableAjaxValidation' => true]);
?>
    <?php 
echo $form->field($register, 'name');
?>
    <?php 
echo $form->field($register, 'email');
?>
    <?php 
echo $form->field($register, 'password')->passwordInput();
?>
    <?php 
echo $form->field($register, 'password_repeat')->passwordInput();
?>
    <?php 
echo $form->field($register, 'sendmail')->widget(Check::className())->label(false);
ActiveForm::endWithActions(['cancel' => ['options' => ['data-dismiss' => 'modal']]]);
<?php

use app\widgets\ActiveForm;
use app\widgets\Check;
use yii\helpers\ArrayHelper;
/** @var $this yii\web\View */
/** @var $form app\widgets\ActiveForm */
/** @var $model app\forms\Profile */
$form = ActiveForm::begin(['id' => 'user-profile-admin-form', 'layout' => 'horizontal', 'fieldConfig' => ['horizontalCssClasses' => ['label' => 'col-sm-2', 'wrapper' => 'col-sm-10']], 'action' => ['profile', 'id' => $model->getUser()->id, 'tab' => 'admin']]);
?>

    <?php 
echo $form->field($model, 'roles')->widget(Check::className(), ['items' => ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'name'), 'options' => ['class' => 'checkbox-list-vert']]);
?>

    <?php 
echo $form->field($model, 'status')->widget(Check::className(), ['type' => Check::TYPE_RADIO, 'items' => $model->getUser()->getStatusLabels(), 'options' => ['class' => 'checkbox-list-vert']]);
?>

<?php 
ActiveForm::endWithActions(['cancel' => false]);
Example #3
0
 /**
  * Renders tab section content.
  * @param string $section
  * @return string
  */
 protected function renderSection($section)
 {
     $configs = isset($this->_configs[$section]) ? $this->_configs[$section] : Param::getConfigsBySection($section);
     ob_start();
     ob_implicit_flush(false);
     if ($this->pjax) {
         Pjax::begin($this->pjaxOptions);
     }
     $form = ActiveForm::begin(['action' => [$this->id, 'tab' => $section], 'pjax' => $this->pjax]);
     echo Html::hiddenInput('section', $section);
     foreach ($configs as $config) {
         if (!Param::isAccess($config)) {
             continue;
         }
         $title = Yii::t('app', $config->title);
         $field = $form->field($config, "[{$config->id}]value")->hint(Yii::t('app', $config->desc));
         switch ($config->value_type) {
             case Config::TYPE_TEXT:
             case Config::TYPE_URL:
             case Config::TYPE_EMAIL:
             case Config::TYPE_INT:
             case Config::TYPE_NUM:
                 echo $field->textInput()->label($title);
                 break;
             case Config::TYPE_EDITOR:
                 echo $field->textArea()->label($title);
                 break;
             case Config::TYPE_SWITCH:
                 echo $field->widget(Check::className(), ['label' => $title])->label(false);
                 break;
             case Config::TYPE_SELECT:
                 echo $field->widget(Select2::className(), ['items' => $config->options])->label($title);
                 break;
             case Config::TYPE_PASSWORD:
                 echo $field->passwordInput()->label($title);
                 break;
         }
     }
     ActiveForm::endWithActions(['cancel' => false]);
     if ($this->pjax) {
         Pjax::end();
     }
     return ob_get_clean();
 }
Example #4
0
    ?>
</p>
    <ul>
    <?php 
    foreach ($delete->getChildren() as $child) {
        ?>
        <li><?php 
        echo Html::a(e($child->title), ['page/view', 'id' => $child->id]);
        ?>
</li>
    <?php 
    }
    ?>
    </ul>
    <p class="lead"><?php 
    echo Yii::t('app', 'Please select what to do with these pages: ');
    ?>
</p>
    <?php 
    echo $form->field($delete, 'mode')->widget(Check::className(), ['type' => Check::TYPE_RADIO, 'options' => ['class' => 'checkbox-list-vert'], 'items' => $delete->getChoices()]);
    ?>
    <?php 
    echo $form->field($delete, 'parentId')->widget(Select2::className(), ['hideSearch' => false, 'remote' => ['wiki-suggest', 'ign' => $delete->getWiki()->id]])->label(false);
    ?>
    <hr>
<?php 
}
?>

<?php 
ActiveForm::endWithActions(['save' => ['label' => Yii::t('app', 'DELETE'), 'options' => ['class' => 'btn btn-flat bg-red']], 'cancel' => ['url' => ['page/view', 'id' => $delete->getWiki()->id]]]);
Example #5
0
        <?php 
$form = ActiveForm::begin(['id' => 'login-form', 'enableClientValidation' => false]);
?>

        <?php 
echo $form->field($model, 'email', $fieldOptions('envelope'))->label(false)->textInput(['placeholder' => $model->getAttributeLabel('email')]);
?>

        <?php 
echo $form->field($model, 'password', $fieldOptions('lock'))->label(false)->passwordInput(['placeholder' => $model->getAttributeLabel('password')]);
?>

        <div class="row">
            <div class="col-xs-8">
                <?php 
echo $form->field($model, 'rememberMe')->widget(Check::className())->label(false);
?>
            </div>
            <!-- /.col -->
            <div class="col-xs-4">
                <?php 
echo Html::submitButton(Yii::t('app', 'Sign in'), ['class' => 'btn btn-primary btn-block btn-flat', 'name' => 'login-button']);
?>
            </div>
            <!-- /.col -->
        </div>

        <?php 
ActiveForm::end();
?>
Example #6
0
    }
    if ($model['label'] > 50) {
        $color = 'bg-yellow';
    }
    if ($model['label'] > 80) {
        $color = 'bg-green';
    }
    return Html::tag('span', $model['label'] . '%', ['class' => 'badge ' . $color]);
}, 'format' => 'html']]]);
?>
        <?php 
Box::end();
?>
        
        <?php 
echo Tabs::widget(['items' => [['label' => 'Tab 1', 'content' => '<div>' . Check::widget(['name' => 'chk1', 'label' => 'Enable report']) . '</div><div>' . Check::widget(['name' => 'chk2', 'label' => 'Send email', 'value' => true]) . '</div>'], ['label' => 'Tab 2', 'content' => ProgressBar::widget(['style' => ProgressBar::STYLE_SUCCESS, 'value' => 30, 'vertical' => true]) . ProgressBar::widget(['style' => ProgressBar::STYLE_WARNING, 'value' => 60, 'vertical' => true]) . ProgressBarGroup::widget(['value' => 82, 'label' => 'Processing'])], ['label' => 'Tab 3', 'content' => 'Content 3...'], ['label' => 'Dropdown', 'items' => [['label' => 'Label', 'content' => '....'], ['label' => 'Label', 'content' => '....']]]]]);
?>
        
    </div>
    
    <div class="col-md-6">
        <?php 
Box::begin(['box' => Box::BOX_PRIMARY, 'label' => 'Box 1', 'collapsable' => true, 'solid' => true]);
?>
            The body of the box. The body of the box. The body of the box.
            <?php 
app\widgets\Modal::begin(['toggleButton' => ['label' => 'Modal with remote content.', 'class' => 'btn btn-flat btn-success'], 'header' => '<b>Remote content</b>', 'remote' => ['modal-remote']]);
?>
                <p class="text-center text-capitalize">Loading...</p>
            <?php 
app\widgets\Modal::end();