[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/plugins/webservices/templates/ -> templates.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Templates
   5   * @subpackage  Webservices.Templates
   6   *
   7   * @copyright   (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9  
  10   * @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
  11   */
  12  
  13  use Joomla\CMS\Plugin\CMSPlugin;
  14  use Joomla\CMS\Router\ApiRouter;
  15  
  16  // phpcs:disable PSR1.Files.SideEffects
  17  \defined('_JEXEC') or die;
  18  // phpcs:enable PSR1.Files.SideEffects
  19  
  20  /**
  21   * Web Services adapter for com_templates.
  22   *
  23   * @since  4.0.0
  24   */
  25  class PlgWebservicesTemplates extends CMSPlugin
  26  {
  27      /**
  28       * Load the language file on instantiation.
  29       *
  30       * @var    boolean
  31       * @since  4.0.0
  32       */
  33      protected $autoloadLanguage = true;
  34  
  35      /**
  36       * Registers com_templates's API's routes in the application
  37       *
  38       * @param   ApiRouter  &$router  The API Routing object
  39       *
  40       * @return  void
  41       *
  42       * @since   4.0.0
  43       */
  44      public function onBeforeApiRoute(&$router)
  45      {
  46          $router->createCRUDRoutes(
  47              'v1/templates/styles/site',
  48              'styles',
  49              ['component' => 'com_templates', 'client_id' => 0]
  50          );
  51  
  52          $router->createCRUDRoutes(
  53              'v1/templates/styles/administrator',
  54              'styles',
  55              ['component' => 'com_templates', 'client_id' => 1]
  56          );
  57      }
  58  }


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