[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

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

   1  <?php
   2  
   3  /**
   4   * Joomla! Content Management System
   5   *
   6   * @copyright  (C) 2012 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\HTML\HTMLHelper;
  13  
  14  // phpcs:disable PSR1.Files.SideEffects
  15  \defined('JPATH_PLATFORM') or die;
  16  // phpcs:enable PSR1.Files.SideEffects
  17  
  18  /**
  19   * Form Field class for the Joomla! CMS.
  20   *
  21   * @since  3.0
  22   */
  23  class HeadertagField extends ListField
  24  {
  25      /**
  26       * The form field type.
  27       *
  28       * @var    string
  29       * @since  3.0
  30       */
  31      protected $type = 'HeaderTag';
  32  
  33      /**
  34       * Method to get the field options.
  35       *
  36       * @return  array  The field option objects.
  37       *
  38       * @since   3.0
  39       */
  40      protected function getOptions()
  41      {
  42          $options = array();
  43          $tags = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'div');
  44  
  45          // Create one new option object for each tag
  46          foreach ($tags as $tag) {
  47              $tmp = HTMLHelper::_('select.option', $tag, $tag);
  48              $options[] = $tmp;
  49          }
  50  
  51          reset($options);
  52  
  53          return $options;
  54      }
  55  }


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