Last active
December 3, 2015 11:35
-
-
Save Deele/3d15aa0c17c836c106e9 to your computer and use it in GitHub Desktop.
Yii2 Bootstrap ActiveForm horizontal layout checkbox syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment