CoreFiles by mySites.guru
DisplayController.php58 lines, 1,698 bytes, from Joomla_4.2.1-rc2-Release_Candidate-Full_Package.zip
Raw History Compare with 4.2.1-rc1
md5
a8df7e45fc58e266dadfa072e69b0f95
sha1
8d08c0632b6faee15c2ce3a57da3dea257117723
sha256
cc7faed61ab4c3f694e54d8526e05a84216451bc07e2d0645880b10fc5755c66
<?php

/**
 * @package     Joomla.Site
 * @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\Site\Controller;

use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\Component\Finder\Administrator\Helper\LanguageHelper;

/**
 * Finder Component Controller.
 *
 * @since  2.5
 */
class DisplayController extends BaseController
{
    /**
     * Method to display a view.
     *
     * @param   boolean  $cachable   If true, the view output will be cached. [optional]
     * @param   array    $urlparams  An array of safe URL parameters and their variable types,
     *                               for valid values see {@link \JFilterInput::clean()}. [optional]
     *
     * @return  static  This object is to support chaining.
     *
     * @since   2.5
     */
    public function display($cachable = false, $urlparams = array())
    {
        $input = $this->app->input;
        $cachable = true;

        // Load plugin language files.
        LanguageHelper::loadPluginLanguage();

        // Set the default view name and format from the Request.
        $viewName = $input->get('view', 'search', 'word');
        $input->set('view', $viewName);

        // Don't cache view for search queries
        if ($input->get('q', null, 'string') || $input->get('f', null, 'int') || $input->get('t', null, 'array')) {
            $cachable = false;
        }

        $safeurlparams = array(
            'f'    => 'INT',
            'lang' => 'CMD'
        );

        return parent::display($cachable, $safeurlparams);
    }
}

The same content is in 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.