1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Cms\Model\Page\Source;
- use Magento\Framework\Data\OptionSourceInterface;
- use Magento\Framework\View\Design\Theme\Label\ListInterface;
- /**
- * Class Theme
- */
- class Theme implements OptionSourceInterface
- {
- /**
- * @var \Magento\Framework\View\Design\Theme\Label\ListInterface
- */
- protected $themeList;
- /**
- * Constructor
- *
- * @param ListInterface $themeList
- */
- public function __construct(ListInterface $themeList)
- {
- $this->themeList = $themeList;
- }
- /**
- * Get options
- *
- * @return array
- */
- public function toOptionArray()
- {
- $options[] = ['label' => 'Default', 'value' => ''];
- return array_merge($options, $this->themeList->getLabels());
- }
- }
|