Closed simialbi closed 5 years ago
Introduced $checkOptions to make checkboxes fully configurable via widget factory.
$checkOptions
I'm not sure if this is the best way to go. But it would make it possible to override all classes via config like this:
$config = [ 'id' => 'basic', 'basePath' => dirname(__DIR__), 'extensions' => require __DIR__ . '/../vendor/yiisoft/extensions.php', 'container' => [ 'definitions' => [ 'yii\bootstrap4\ActiveField' => [ 'checkTemplate' => "<div class=\"form-check\">\n{input}\n{label}\n{error}\n{hint}\n</div>", 'radioTemplate' => "<div class=\"form-check\">\n{input}\n{label}\n{error}\n{hint}\n</div>", 'checkHorizontalTemplate' => "{beginWrapper}\n<div class=\"form-check\">\n{input}\n{label}\n{error}\n{hint}\n</div>\n{endWrapper}", 'radioHorizontalTemplate' => "{beginWrapper}\n<div class=\"form-check\">\n{input}\n{label}\n{error}\n{hint}\n</div>\n{endWrapper}", 'checkOptions' => [ 'class' => ['widget' => 'form-check-input'], 'labelOptions' => [ 'class' => ['widget' => 'form-check-label'] ], 'wrapperOptions' => [ 'class' => ['widget' => 'form-check'] ] ] ] ] ] ];
Merged. Thank you!
Introduced
$checkOptions
to make checkboxes fully configurable via widget factory.I'm not sure if this is the best way to go. But it would make it possible to override all classes via config like this: