Upgrade to 4.2.0
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Kirby\Cms;
|
||||
|
||||
use Closure;
|
||||
use Kirby\Exception\InvalidArgumentException;
|
||||
use Kirby\Toolkit\Component;
|
||||
|
||||
@@ -46,6 +47,21 @@ class Section extends Component
|
||||
parent::__construct($type, $attrs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns field api call
|
||||
*/
|
||||
public function api(): mixed
|
||||
{
|
||||
if (
|
||||
isset($this->options['api']) === true &&
|
||||
$this->options['api'] instanceof Closure
|
||||
) {
|
||||
return $this->options['api']->call($this);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function errors(): array
|
||||
{
|
||||
if (array_key_exists('errors', $this->methods) === true) {
|
||||
|
Reference in New Issue
Block a user