[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_contenthistory/src/View/Compare/ -> HtmlView.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_contenthistory
   6   *
   7   * @copyright   (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  namespace Joomla\Component\Contenthistory\Administrator\View\Compare;
  12  
  13  use Joomla\CMS\MVC\View\GenericDataException;
  14  use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
  15  
  16  // phpcs:disable PSR1.Files.SideEffects
  17  \defined('_JEXEC') or die;
  18  // phpcs:enable PSR1.Files.SideEffects
  19  
  20  /**
  21   * View class for a list of contenthistory.
  22   *
  23   * @since  3.2
  24   */
  25  class HtmlView extends BaseHtmlView
  26  {
  27      /**
  28       * An array of items
  29       *
  30       * @var  array
  31       */
  32      protected $items;
  33  
  34      /**
  35       * The model state
  36       *
  37       * @var  \Joomla\CMS\Object\CMSObject
  38       */
  39      protected $state;
  40  
  41      /**
  42       * Method to display the view.
  43       *
  44       * @param   string  $tpl  A template file to load. [optional]
  45       *
  46       * @return  void
  47       *
  48       * @since   3.2
  49       */
  50      public function display($tpl = null)
  51      {
  52          $this->state = $this->get('State');
  53          $this->items = $this->get('Items');
  54  
  55          // Check for errors.
  56          if (count($errors = $this->get('Errors'))) {
  57              throw new GenericDataException(implode("\n", $errors), 500);
  58          }
  59  
  60          parent::display($tpl);
  61      }
  62  }


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