Update Composer packages
This commit is contained in:
parent
0320235f6c
commit
a8b68fb61b
378 changed files with 28466 additions and 28852 deletions
30
kirby/src/Option/OptionsProvider.php
Normal file
30
kirby/src/Option/OptionsProvider.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Kirby\Option;
|
||||
|
||||
use Kirby\Cms\ModelWithContent;
|
||||
|
||||
/**
|
||||
* Abstract class as base for dynamic options
|
||||
* providers like OptionsApi and OptionsQuery
|
||||
*
|
||||
* @package Kirby Option
|
||||
* @author Nico Hoffmann <nico@getkirby.com>
|
||||
* @link https://getkirby.com
|
||||
* @copyright Bastian Allgeier
|
||||
* @license https://opensource.org/licenses/MIT
|
||||
*/
|
||||
abstract class OptionsProvider
|
||||
{
|
||||
public Options|null $options = null;
|
||||
|
||||
/**
|
||||
* Returns options as array
|
||||
*/
|
||||
public function render(ModelWithContent $model)
|
||||
{
|
||||
return $this->resolve($model)->render($model);
|
||||
}
|
||||
|
||||
abstract public function resolve(ModelWithContent $model): Options;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue