Skip to content

Commit

Permalink
Fix config (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Dec 24, 2021
1 parent 0d8993f commit 613d69f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 25 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -53,7 +53,7 @@
},
"config-plugin": {
"params": "params.php",
"web": "web/*.php"
"widgets": "widgets.php"
}
},
"config": {
Expand Down
23 changes: 10 additions & 13 deletions config/params.php
Expand Up @@ -2,23 +2,20 @@

declare(strict_types=1);

/**
* @link https://bulma.io/documentation/form/general/#complete-form-example
*/
/** @link https://bulma.io/documentation/form/general/#complete-form-example */

return [
'yiisoft/form' => [
'bulma' => [
'enabled' => true,
'fieldConfig' => [
'containerClass' => 'field',
'errorClass' => 'has-text-danger is-italic',
'hintClass' => 'help',
'inputClass' => 'input',
'invalidClass' => 'has-background-danger',
'labelClass' => 'label',
'template' => "{label}<div class=\"control\">\n{input}</div>\n{hint}\n{error}",
'validClass' => 'has-background-success',
],
'containerClass' => 'field',
'errorClass' => 'has-text-danger is-italic',
'hintClass' => 'help',
'inputClass' => 'input',
'invalidClass' => 'has-background-danger',
'labelClass' => 'label',
'template' => "{label}<div class=\"control\">\n{input}</div>\n{hint}\n{error}",
'validClass' => 'has-background-success',
],
],
];
11 changes: 0 additions & 11 deletions config/web/field.php

This file was deleted.

22 changes: 22 additions & 0 deletions config/widgets.php
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

use Yiisoft\Form\Widget\Field;

/** @var array $params */

if ($params['yiisoft/form']['bulma']['enabled'] === true) {
return [
Field::class => [
'containerClass()' => [$params['yiisoft/form']['bulma']['containerClass']],
'errorClass()' => [$params['yiisoft/form']['bulma']['errorClass']],
'hintClass()' => [$params['yiisoft/form']['bulma']['hintClass']],
'inputClass()' => [$params['yiisoft/form']['bulma']['inputClass']],
'invalidClass()' => [$params['yiisoft/form']['bulma']['invalidClass']],
'labelClass()' => [$params['yiisoft/form']['bulma']['labelClass']],
'template()' => [$params['yiisoft/form']['bulma']['template']],
'validClass()' => [$params['yiisoft/form']['bulma']['validClass']],
],
];
}

0 comments on commit 613d69f

Please sign in to comment.