mirror of
https://github.com/getgrav/grav.git
synced 2026-07-11 18:13:05 +02:00
FlexForm: Fixed some compatibility issues with Form plugin
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
|
||||
1. [](#improved)
|
||||
* Improved language support
|
||||
1. [](#bugfix)
|
||||
* `FlexForm`: Fixed some compatibility issues with Form plugin
|
||||
|
||||
# v1.7.0-beta.6
|
||||
## 08/29/2019
|
||||
|
||||
@@ -17,6 +17,7 @@ use Grav\Framework\Flex\Interfaces\FlexFormInterface;
|
||||
use Grav\Framework\Flex\Interfaces\FlexObjectInterface;
|
||||
use Grav\Framework\Form\Traits\FormTrait;
|
||||
use Grav\Framework\Route\Route;
|
||||
use RocketTheme\Toolbox\ArrayTraits\NestedArrayAccessWithGetters;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\SyntaxError;
|
||||
use Twig\Template;
|
||||
@@ -28,6 +29,10 @@ use Twig\TemplateWrapper;
|
||||
*/
|
||||
class FlexForm implements FlexFormInterface
|
||||
{
|
||||
use NestedArrayAccessWithGetters {
|
||||
NestedArrayAccessWithGetters::get as private traitGet;
|
||||
NestedArrayAccessWithGetters::set as private traitSet;
|
||||
}
|
||||
use FormTrait {
|
||||
FormTrait::doSerialize as doTraitSerialize;
|
||||
FormTrait::doUnserialize as doTraitUnserialize;
|
||||
@@ -134,6 +139,52 @@ class FlexForm implements FlexFormInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param mixed $default
|
||||
* @param string|null $separator
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($name, $default = null, $separator = null)
|
||||
{
|
||||
switch (strtolower($name)) {
|
||||
case 'id':
|
||||
case 'uniqueid':
|
||||
case 'name':
|
||||
case 'noncename':
|
||||
case 'nonceaction':
|
||||
case 'action':
|
||||
case 'data':
|
||||
case 'files':
|
||||
case 'errors';
|
||||
case 'fields':
|
||||
case 'blueprint':
|
||||
case 'page':
|
||||
$method = 'get' . $name;
|
||||
return $this->{$method}();
|
||||
}
|
||||
|
||||
return $this->traitGet($name, $default, $separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param mixed $value
|
||||
* @param string|null $separator
|
||||
* @return FlexForm
|
||||
*/
|
||||
public function set($name, $value, $separator = null)
|
||||
{
|
||||
switch (strtolower($name)) {
|
||||
case 'id':
|
||||
case 'uniqueid':
|
||||
$method = 'set' . $name;
|
||||
return $this->{$method}();
|
||||
}
|
||||
|
||||
return $this->traitSet($name, $value, $separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user