CoreFiles by mySites.guru
HtmlView.php61 lines, 1,384 bytes, from Joomla_6.0.0-beta1-Beta-Full_Package.zip
Raw History Compare with 5.4.0-beta3
md5
3d1f05f3171cc2ad4518d08c55218244
sha1
b14fd2f24dab8ab49a995f852ade34113a18fe70
sha256
c173b923b684e06fdfedb5a57c2081f7b957aa9371e236fd528479b212b3d56f
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_finder
 *
 * @copyright   (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Finder\Administrator\View\Statistics;

use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\Component\Finder\Administrator\Model\StatisticsModel;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Statistics view class for Finder.
 *
 * @since  2.5
 */
class HtmlView extends BaseHtmlView
{
    /**
     * The index statistics
     *
     * @var    \stdClass
     *
     * @since  3.6.1
     */
    protected $data;

    /**
     * Method to display the view.
     *
     * @param   string  $tpl  A template file to load. [optional]
     *
     * @return  void
     *
     * @since   2.5
     */
    public function display($tpl = null)
    {
        /** @var StatisticsModel $model */
        $model = $this->getModel();

        // Load the view data.
        $this->data = $model->getData();

        // Check for errors.
        if (\count($errors = $model->getErrors())) {
            throw new GenericDataException(implode("\n", $errors), 500);
        }

        parent::display($tpl);
    }
}

The same content is in 4 releases, Joomla 6.0.0-alpha1 to 6.0.0-beta1. See them all, or every version of this file.