kartik-v / yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).
http://demos.krajee.com/widget-details/active-form
Other
64 stars 35 forks source link

Global template override only works on form type horizontal #86

Closed cleippi closed 5 years ago

cleippi commented 7 years ago

Prerequisites

Steps to reproduce the issue

Include the following in the bootstrap.php file:

\Yii::$container->set('kartik\form\ActiveField', [
    'template' => "{label}\n{error}\n{input}\n{hint}",
]);

Check $template variable on any ActiveField, and it's still the default of error last. The template should have been updated so that error is between label and input.

However, if I also include the following, then it works as expected:

\Yii::$container->set('kartik\widgets\ActiveForm', [
        'type' => \kartik\form\ActiveForm::TYPE_HORIZONTAL
]);

The problem is that I do not wish to use horizontal forms. I prefer the vertical layout.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.