本文整理匯總了PHP中Illuminate\Routing\Router::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Router::__construct方法的具體用法?PHP Router::__construct怎麽用?PHP Router::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Illuminate\Routing\Router
的用法示例。
在下文中一共展示了Router::__construct方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Router constructor.
* @param Dispatcher $events
* @param Container $container
*/
public function __construct(Dispatcher $events, Container $container)
{
parent::__construct($events, $container);
$this->setRoutes(new RouteCollection());
$this->adapterService = new AdapterService($this->container);
$this->setDefaultAdapter(MainAdapter::name);
}
示例2: __construct
/**
* Load resource defaults and call parent
*
* @param Illuminate\Events\Dispatcher $events
* @param Illuminate\Container\Container $container
* @param Illuminate\Config\Repository $config
* @param array $resourceDefaults
* @return void
*/
public function __construct($events, $container, $config, $resourceDefaults)
{
// Capture config
$this->config = $config;
// Load defaults
$this->resourceDefaults = $resourceDefaults;
// Hand off to parent
return parent::__construct($events, $container);
}
示例3: __construct
/**
* Router constructor method
*
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @param \Illuminate\Container\Container|null $container
*/
public function __construct(Dispatcher $events, Container $container = null)
{
parent::__construct($events, $container);
$this->config = Config::get('lera');
$this->createResources();
}
示例4: __construct
/**
* Create a new Router instance.
*
* @param Dispatcher $events
* @param Container $container
* @return void
*/
public function __construct(Dispatcher $events, Container $container = null)
{
parent::__construct($events, $container);
$this->routes = new RouteCollection();
}
示例5: __construct
public function __construct(Dispatcher $events, Container $container = null)
{
parent::__construct($events, $container);
$this->version = substr($container::VERSION, 0, 3);
}
示例6: __construct
/**
* Create a new router instance.
*
* @param \Illuminate\Events\Dispatcher $events
* @param \Dingo\Api\Properties $properties
* @param \Illuminate\Container\Container $container
*
* @return void
*/
public function __construct(Dispatcher $events, Properties $properties, Container $container = null)
{
$this->properties = $properties;
$this->api = new GroupCollection($properties);
parent::__construct($events, $container);
}
示例7: __construct
/**
* Create a new Router instance.
*
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @param \Illuminate\Container\Container $container
*/
public function __construct(Dispatcher $events, Container $container = null)
{
parent::__construct($events, $container);
// Add all registered named route middlewares after all service providers have been loaded
app('events')->listen('bootstrapped: ' . BootProviders::class, RegisterRouteMiddleware::class);
}
示例8: __construct
/**
* Setup options for routing and pass container to parent
*
* @param \Illuminate\Container\Container $container
* @return void
*/
public function __construct(\Illuminate\Container\Container $container = null)
{
parent::__construct($container);
$this->setOptions();
$this->setExpressions();
}
示例9: __construct
/**
* Create a new TranslatorRouter instance.
*
* @param \Translator\Localizer $localizer
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @param \Illuminate\Container\Container $container
* @return void
*/
public function __construct(Localizer $localizer, Dispatcher $events, Container $container = null)
{
parent::__construct($events, $container);
$this->localizer = $localizer;
}
示例10: __construct
/**
* Router constructor.
*
* @param Dispatcher $events
* @param Container|null $container
*/
public function __construct(Dispatcher $events, Container $container = null)
{
parent::__construct($events, $container);
}