PHP code example of marcusirgens / jsend-factory
1. Go to this page and download the library: Download marcusirgens/jsend-factory library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
marcusirgens / jsend-factory example snippets
$responseFactory = new Psr17ResponseFactory();
$streamFactory = new Psr17StreamFactory();
$jsendFactory = \MarcusIrgens\JSendFactory\JSendFactory(
$responseFactory,
$streamFactory
);
$successResponse = $jsendFactory->getSuccess(["message" => "hello"]);