本文整理汇总了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);
}