[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_media/src/Controller/ -> DisplayController.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_media
   6   *
   7   * @copyright   (C) 2007 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\Media\Administrator\Controller;
  12  
  13  use Joomla\CMS\MVC\Controller\BaseController;
  14  
  15  // phpcs:disable PSR1.Files.SideEffects
  16  \defined('_JEXEC') or die;
  17  // phpcs:enable PSR1.Files.SideEffects
  18  
  19  /**
  20   * Media Manager Component Controller
  21   *
  22   * @since  4.0.0
  23   */
  24  class DisplayController extends BaseController
  25  {
  26      /**
  27       * The default view.
  28       *
  29       * @var    string
  30       * @since  1.6
  31       */
  32      protected $default_view = 'media';
  33  
  34      /**
  35       * Method to get a reference to the current view and load it if necessary.
  36       *
  37       * @param   string  $name    The view name. Optional, defaults to the controller name.
  38       * @param   string  $type    The view type. Optional.
  39       * @param   string  $prefix  The class prefix. Optional.
  40       * @param   array   $config  Configuration array for view. Optional.
  41       *
  42       * @return  \Joomla\CMS\MVC\View\ViewInterface  Reference to the view or an error.
  43       *
  44       * @since   3.0
  45       * @throws  \Exception
  46       */
  47      public function getView($name = '', $type = '', $prefix = '', $config = [])
  48      {
  49          // Force to load the admin view
  50          return parent::getView($name, $type, 'Administrator', $config);
  51      }
  52  
  53      /**
  54       * Method to get a model object, loading it if required.
  55       *
  56       * @param   string  $name    The model name. Optional.
  57       * @param   string  $prefix  The class prefix. Optional.
  58       * @param   array   $config  Configuration array for model. Optional.
  59       *
  60       * @return  \Joomla\CMS\MVC\Model\BaseDatabaseModel|boolean  Model object on success; otherwise false on failure.
  61       *
  62       * @since   3.0
  63       */
  64      public function getModel($name = '', $prefix = '', $config = [])
  65      {
  66          // Force to load the admin model
  67          return parent::getModel($name, 'Administrator', $config);
  68      }
  69  }


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