working on it ...

Filters

Explore Public Snippets

Sort by

Found 6 snippets matching: activeform

    public by kbudylov modified Jan 26, 2017  1747  14  5  0

    Yii2 $form->field

    <?= $form->field($model,'field',[
      //'template' => '{input}',
      //'options' => [
        //'class' => ''
      //]
    ])->textField([
      //'class' => ''
    ]) ?>

    public by petschephp modified May 9, 2013  2828  0  4  0

    ActiveForm

    TbActiveForm Yii
    <?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
    		'id'=>'line-item-category-form',
    		'enableAjaxValidation'=>false,
    	)); ?>
    		<div class="" >
    			<?php $this->widget('bootstrap.widgets.TbButton', array(
    				'buttonType'=>'submit',
    				'type'=>'primary',
    				'label'=>$model->isNewRecord ? 'Create' : 'Save',
    			)); ?>
    		</div>
    	
    <?php $this->endWidget(); ?>

    external by compleatguru modified Nov 22, 2016  80  0  1  0

    How to render Yii2 ActiveForm as a 3rd Party library

    How to render Yii2 ActiveForm as a 3rd Party library: view.php
    <?php
    // Refer to http://www.yiiframework.com/doc-2.0/guide-tutorial-yii-integration.html
    // A missing part is about how to render an ActiveForm in 3rd System, so that the necessary javascript files will be shown
    // yii_bootstrap is the same codes give from the link above
    /*
    * require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
    *
    * $yiiConfig = require(__DIR__ . '/../config/yii/web.php');
    * new yii\web\Application($yiiConfig); // Do NOT call run() here
    */
        include('yii_bootstrap.php');
    ?>
    <?php
    use yii\helpers\Html;
    use yii\widgets\ActiveForm;
    use app\models\LoginForm;
    ?>
    <?php
        $model = new LoginForm;
    ?>
    <?php $view = Yii::$app->view ?>
    <html>
    <?php $view->beginPage()?>
    <head>
    <?php $view->head()?>
    </head>
    <body>
    <?php $view->beginBody()?>
    <?php $form = ActiveForm::begin([
        'id' => 'login-form',
        'options' => ['class' => 'form-horizontal'],
    ]); ?>
    
        <?= $form->field($model, 'username') ?>
    
        <?= $form->field($model, 'password') ?>
    
        <div class="form-group">
            <?= Html::submitButton('Submit', ['class' => 'btn btn-primary']) ?>
        </div>
    
    <?php ActiveForm::end(); ?>
    <?php $view->endBody()?>
    </body>
    <?php $view->endPage()?>
    </html>
    
    

    external by Mopkau modified Jul 5, 2016  45  0  1  0

    Yii2 ActiveForm with ClearActiveInput

    Yii2 ActiveForm with ClearActiveInput: ActiveFormClear
    <?php
    
      $form = ActiveForm::begin(
      
      [
      
          'id' => '',
          
          'fieldClass'=>ClearActiveField::className()]
          
      ); 
      
    ?>
    
          <?php echo $form->field($model, 'title')->textInput(['placeholder'=>'Placeholder'])->label(false) ?>
    			
    			<?php echo $form->field($model, 'count_kids')->dropDownList(range(0,12), ['prompt' => 'Empty'])->label(false) ?>
    
    <?php 
      ActiveForm::end();
    
    

    external by Deele modified Dec 3, 2015  1760  3  3  0

    Yii2 Bootstrap ActiveForm horizontal layout checkbox syntax

    Yii2 Bootstrap ActiveForm horizontal layout checkbox syntax: horizontal-bootstrap-activeform-checkbox-view.php
    <?php
    use yii\bootstrap\ActiveForm;
    use yii\bootstrap\ActiveField;
    $activeField = new ActiveField();
    ?><div class="tour-form">
        <?php $form = ActiveForm::begin(); ?>
        <div class="form-horizontal">
        <?php
    echo <<<HTML
    {$form->field(
        $model,
        'is_title_shown',
        [
            'wrapperOptions' => ['class' => 'col-sm-offset-4 col-sm-8'],
        ]
    )->checkbox([
        'template'=> $activeField->horizontalCheckboxTemplate,
    ])}
    HTML
        ?>
        </div>
        <?php ActiveForm::end(); ?>
    </div>
    
    

    external by egulhan modified Dec 12, 2014  150  10  2  0

    How to set error css classes in Yii ActiveForm manually

    How to set error css classes in Yii ActiveForm manually: yii-activeform-error-css-class.php
    PHP
    <?php $form=$this->beginWidget('CActiveForm', array(
    	'id'=>'login-form',
    	'enableClientValidation'=>true,
    	'clientOptions'=>array(
    		'validateOnSubmit'=>true,		
    		'inputContainer'=>'.form-group',
    		'errorCssClass'=>'has-error',
    	),
    	'errorMessageCssClass'=>'help-block',
    )); ?>
    	<div class="row">
    		<div class="col-md-6">
    			<h2><?php echo Helper::t("LOGIN"); ?></h2>
    			<div class="form-group">
    				<?php echo $form->labelEx($model,'username', array('class'=>'col-md-4 control-label')); ?>
    				<div class="col-md-8">
    					<?php echo $form->textField($model,'username', array('class'=>'form-control','autocomplete'=>'off')); ?>
    				</div>
    				<?php echo $form->error($model,'username'); ?>
    			</div>
    			<!-- ... -->
    		</div>
    	</div>
    <?php $this->endWidget(); ?>
    
    

    List Complete ( 6 snippets total )

    • Public Snippets
    • Channels Snippets