[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Form/Field/ -> CachehandlerField.php (source)

   1  <?php
   2  
   3  /**
   4   * Joomla! Content Management System
   5   *
   6   * @copyright  (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
   7   * @license    GNU General Public License version 2 or later; see LICENSE.txt
   8   */
   9  
  10  namespace Joomla\CMS\Form\Field;
  11  
  12  use Joomla\CMS\Cache\Cache;
  13  use Joomla\CMS\HTML\HTMLHelper;
  14  use Joomla\CMS\Language\Text;
  15  
  16  // phpcs:disable PSR1.Files.SideEffects
  17  \defined('JPATH_PLATFORM') or die;
  18  // phpcs:enable PSR1.Files.SideEffects
  19  
  20  /**
  21   * Form Field class for the Joomla Platform.
  22   * Provides a list of available cache handlers
  23   *
  24   * @see    JCache
  25   * @since  1.7.0
  26   */
  27  class CachehandlerField extends ListField
  28  {
  29      /**
  30       * The form field type.
  31       *
  32       * @var    string
  33       * @since  1.7.0
  34       */
  35      protected $type = 'Cachehandler';
  36  
  37      /**
  38       * Method to get the field options.
  39       *
  40       * @return  array  The field option objects.
  41       *
  42       * @since   1.7.0
  43       */
  44      protected function getOptions()
  45      {
  46          $options = array();
  47  
  48          // Convert to name => name array.
  49          foreach (Cache::getStores() as $store) {
  50              $options[] = HTMLHelper::_('select.option', $store, Text::_('JLIB_FORM_VALUE_CACHE_' . $store), 'value', 'text');
  51          }
  52  
  53          $options = array_merge(parent::getOptions(), $options);
  54  
  55          return $options;
  56      }
  57  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer