PHP code example of yauhenko / rest-bundle
1. Go to this page and download the library: Download yauhenko/rest-bundle 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/ */
yauhenko / rest-bundle example snippets
namespace App;
use Yauhenko\RestBundle\TypesInterface;
use Yauhenko\RestBundle\Service\TypeScript;
class Types implements TypesInterface {
public static function registerTypes(TypeScript $ts): void {
// register custom types here (optional)
$ts->registerTypeOf('TBadge', ['notifications', 'shop']);
// register interfaces
$ts->registerInterfacesFromDir(__DIR__ . '/Entity');
$ts->registerInterfacesFromDir(__DIR__ . '/Models');
}
public static function codePostProcessor(string $code): string {
// change generated TypeScript code here (optional)
return $code;
}
}