[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Plugin 5 * @subpackage Webservices.Plugins 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 use Joomla\Router\Route; 16 17 // phpcs:disable PSR1.Files.SideEffects 18 \defined('_JEXEC') or die; 19 // phpcs:enable PSR1.Files.SideEffects 20 21 /** 22 * Web Services adapter for com_plugins. 23 * 24 * @since 4.0.0 25 */ 26 class PlgWebservicesPlugins extends CMSPlugin 27 { 28 /** 29 * Load the language file on instantiation. 30 * 31 * @var boolean 32 * @since 4.0.0 33 */ 34 protected $autoloadLanguage = true; 35 36 /** 37 * Registers com_plugins's API's routes in the application 38 * 39 * @param ApiRouter &$router The API Routing object 40 * 41 * @return void 42 * 43 * @since 4.0.0 44 */ 45 public function onBeforeApiRoute(&$router) 46 { 47 $defaults = ['component' => 'com_plugins']; 48 $getDefaults = array_merge(['public' => false], $defaults); 49 50 $routes = [ 51 new Route(['GET'], 'v1/plugins', 'plugins.displayList', [], $getDefaults), 52 new Route(['GET'], 'v1/plugins/:id', 'plugins.displayItem', ['id' => '(\d+)'], $getDefaults), 53 new Route(['PATCH'], 'v1/plugins/:id', 'plugins.edit', ['id' => '(\d+)'], $defaults), 54 ]; 55 56 $router->addRoutes($routes); 57 } 58 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |