Set the defult format.
public setDefaultFormat ( string $format ) : void | ||
$format | string | |
return | void |
/** * Register the internal dispatcher. * * @return void */ public function registerDispatcher() { $this->app->singleton('api.dispatcher', function ($app) { $dispatcher = new Dispatcher($app, $app['files'], $app['api.router'], $app['api.auth']); $config = $app['config']['api']; $dispatcher->setVendor($config['vendor']); $dispatcher->setPrefix($config['prefix']); $dispatcher->setDefaultVersion($config['version']); $dispatcher->setDefaultDomain($config['domain']); $dispatcher->setDefaultFormat($config['defaultFormat']); return $dispatcher; }); }
/** * Set the defult format. * * @param string $format * @return void * @static */ public static function setDefaultFormat($format) { \Dingo\Api\Dispatcher::setDefaultFormat($format); }
/** * Register the internal dispatcher. * * @return void */ public function registerDispatcher() { $this->app->singleton('api.dispatcher', function ($app) { $dispatcher = new Dispatcher($app, $app['files'], $app['Dingo\\Api\\Routing\\Router'], $app['Dingo\\Api\\Auth\\Auth']); $dispatcher->setSubtype($this->config('subtype')); $dispatcher->setStandardsTree($this->config('standardsTree')); $dispatcher->setPrefix($this->config('prefix')); $dispatcher->setDefaultVersion($this->config('version')); $dispatcher->setDefaultDomain($this->config('domain')); $dispatcher->setDefaultFormat($this->config('defaultFormat')); return $dispatcher; }); }
/** * Register the internal dispatcher. * * @author Morten Rugaard <*****@*****.**> * * @return void */ public function registerDispatcher() { $this->app->singleton('api.dispatcher', function ($app) { $dispatcher = new DingoDispatcher($app, $app['files'], $app['api.router'], $app['api.auth']); $dispatcher->setSubtype(config('nodes.api.settings.subtype')); $dispatcher->setStandardsTree(config('nodes.api.settings.standardsTree')); $dispatcher->setPrefix(config('nodes.api.settings.prefix')); $dispatcher->setDefaultVersion(config('nodes.api.settings.version')); $dispatcher->setDefaultDomain(config('nodes.api.settings.domain')); $dispatcher->setDefaultFormat(config('nodes.api.response.defaultFormat')); return $dispatcher; }); }