@Api\Label¶
Add custom label to backend module¶
This Annotation will override the default label that is used in the collapsible elements of the RESTApi backend module. By default, the extension generates this label by evaluating the default or custom routing.
This annotation has no other function in the frontend. It is just for modifying the view in the backend-module and making the labels of the endpoints better legible or for handling edge cases.
The syntax is:
@Api\Label("this is my label!")
Here is a full example:
<?php
namespace My\Extension\Api;
use Nng\Nnrestapi\Annotations as Api;
use Nng\Nnrestapi\Api\AbstractApi;
/**
* @Api\Endpoint()
*/
class Example extends AbstractApi
{
/**
* @Api\Label("this is my label!")
* @Api\Access("public")
*
* @return array
*/
public function getAllAction()
{
return ['nice'=>'result'];
}
}