Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Yii2 Bootstrap ActiveForm horizontal layout checkbox syntax
<?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
You can’t perform that action at this time.