src/app/Controllers/EventController.php
/**
     * Emit a client-side event.
     *
     * @param ServerRequestInterface $request
     * @param ResponseInterface $response
     * @param array $args
     * @return ResponseInterface
     */
Emit a client-side event.
@param ServerRequestInterface $request
@param ResponseInterface $response
@param array $args
@return ResponseInterface
Emit a client - side event . @param ServerRequestInterface $request @param ResponseInterface $response @param array $args @return ResponseInterface
public function postEmit(ServerRequestInterface $request, ResponseInterface $response, $args)
    {
        $params = $request->getParsedBody();
        $name = isset($params['name']) ? $params['name'] : null;
        $attributes = isset($params['params']) ? $params['params'] : [];
        $schema = $this->eventService->emit($name, $attributes);
        return $response->withJson([
            'message' => sprintf('You just triggered the "%s" event!', $schema),
        ]);
    }
public function postEmit ( ServerRequestInterface $ request , ResponseInterface $ response , $ args ) { $ params = $ request -> getParsedBody ( ) ; $ name = isset ( $ params [ 'name' ] ) ? $ params [ 'name' ] : null ; $ attributes = isset ( $ params [ 'params' ] ) ? $ params [ 'params' ] : [ ] ; $ schema = $ this -> eventService -> emit ( $ name , $ attributes ) ; return $ response -> withJson ( [ 'message' => sprintf ( 'You just triggered the "%s" event!' , $ schema ) , ] ) ; }
Emit a client-side event.
Emit a client - side event .