Skip to content

Commit

Permalink
降低版本需求
Browse files Browse the repository at this point in the history
Bugfix
  • Loading branch information
iwillhappy1314 committed Aug 15, 2023
1 parent bb05ad2 commit c372821
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 23 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"description": "Extend Nette Forms for WordPress use.",
"require": {
"ext-json": "*",
"php": ">=8.0",
"nette/forms": "^3.0"
"php": ">=7.2",
"nette/forms": "^3.0",
"nette/utils": "^3.2"
},
"autoload": {
"psr-4": {
Expand Down
27 changes: 13 additions & 14 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions src/Controls/ChosenInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public function getControl(): Html
{

$el = parent::getControl();

$id = $this->getHtmlId();
$settings = $this->settings;

$settings_default = [
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/CloneInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function getControl(): Html
});
</script>';

return Html::fromHtml( $html .$add_button . $scripts );
return Html::fromHtml( $html .$add_button . $scripts )->setName('div');

}

Expand Down
5 changes: 2 additions & 3 deletions src/Controls/TextEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ public function __construct( $label = null, array $settings = null ) {
parent::__construct( $label );
$this->settings = (array) $settings;

$this->setOption( 'type', 'editor' );
$this->setOption( 'type', 'wp_editor' );
}


/**
* 生成控件 HTML 内容
*
Expand Down Expand Up @@ -53,6 +52,6 @@ public function getControl(): Html {
$html = ob_get_contents();
ob_end_clean();

return Html::fromHtml( $html );
return Html::fromHtml( $html )->setName('div');
}
}
2 changes: 1 addition & 1 deletion src/Translator/DefaultTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DefaultTranslator implements Translator
*
* @usage: Translator($message);
*/
public function translate(string|\Stringable $message, mixed ...$parameters): string|\Stringable
public function translate($message, ...$parameters): string
{
return __($message, 'wprs');
}
Expand Down

0 comments on commit c372821

Please sign in to comment.