Adding Rest Api Service Support
Rest Service on plugins
-----------------------
1. enable service
add the following line in plugin __constructor main class
$this->enableRestService(true);
2. Create the sources directory structure by example:
if you plugin is named myPlugin
myPlugin
|--src
|--Services
|--Api
|--MyPlugin
|--Test.php
Where Test.php is a Restler class
This commit is contained in:
@@ -341,10 +341,10 @@ class PMPlugin
|
||||
* @param array/string $pluginJsFile
|
||||
* @return void
|
||||
*/
|
||||
function registerRestService($classname, $path = '')
|
||||
function registerRestService()
|
||||
{
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry->registerRestService($this->sNamespace, $classname, $path);
|
||||
$oPluginRegistry->registerRestService($this->sNamespace);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -360,6 +360,12 @@ class PMPlugin
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry->unregisterRestService($this->sNamespace, $classname, $path);
|
||||
}
|
||||
|
||||
function enableRestService($enable)
|
||||
{
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry->enableRestService($this->sNamespace, $enable);
|
||||
}
|
||||
}
|
||||
|
||||
class menuDetail
|
||||
|
||||
Reference in New Issue
Block a user