init
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Esun\FileManager\Model\Source;
|
||||
|
||||
use Esun\FileManager\Model\Config;
|
||||
use Magento\Framework\Data\OptionSourceInterface;
|
||||
|
||||
class ExtensionOptions implements OptionSourceInterface
|
||||
{
|
||||
public function __construct(private readonly Config $config)
|
||||
{
|
||||
}
|
||||
|
||||
public function toOptionArray(): array
|
||||
{
|
||||
$options = [];
|
||||
foreach ($this->config->getAllowedExtensions() as $extension) {
|
||||
$options[] = ['value' => $extension, 'label' => strtoupper($extension)];
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user