[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_banners/src/View/Download/ -> HtmlView.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_banners
   6   *
   7   * @copyright   (C) 2009 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\Banners\Administrator\View\Download;
  12  
  13  use Exception;
  14  use Joomla\CMS\Form\Form;
  15  use Joomla\CMS\MVC\View\GenericDataException;
  16  use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
  17  use Joomla\Component\Banners\Administrator\Model\DownloadModel;
  18  
  19  // phpcs:disable PSR1.Files.SideEffects
  20  \defined('_JEXEC') or die;
  21  // phpcs:enable PSR1.Files.SideEffects
  22  
  23  /**
  24   * View class for download a list of tracks.
  25   *
  26   * @since  1.6
  27   */
  28  class HtmlView extends BaseHtmlView
  29  {
  30      /**
  31       * The Form object
  32       *
  33       * @var    Form
  34       * @since  1.6
  35       */
  36      protected $form;
  37  
  38      /**
  39       * Display the view
  40       *
  41       * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  42       *
  43       * @return  void
  44       *
  45       * @since   1.6
  46       *
  47       * @throws  Exception
  48       */
  49      public function display($tpl = null): void
  50      {
  51          /** @var DownloadModel $model */
  52          $model      = $this->getModel();
  53          $this->form = $model->getForm();
  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