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
23 lines
313 B
PHP
23 lines
313 B
PHP
<?php
|
|
namespace Services\Api\ProcessMaker;
|
|
|
|
use \ProcessMaker\Services\Api;
|
|
use \Luracast\Restler\RestException;
|
|
|
|
class Test3 extends Api
|
|
{
|
|
|
|
function hello3()
|
|
{
|
|
return 'Hello #3';
|
|
}
|
|
|
|
/**
|
|
* @status 201
|
|
*/
|
|
function post()
|
|
{
|
|
return array('success' => true);
|
|
}
|
|
}
|