本文整理汇总了PHP中Illuminate\Support\ServiceProvider::config方法的典型用法代码示例。如果您正苦于以下问题:PHP ServiceProvider::config方法的具体用法?PHP ServiceProvider::config怎么用?PHP ServiceProvider::config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\ServiceProvider
的用法示例。
在下文中一共展示了ServiceProvider::config方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: register
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
// Configure any bindings that are version dependent
$this->provider->register();
// Let the IoC container be able to make a Symfony event dispatcher
$this->app->bind('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface', 'Symfony\\Component\\EventDispatcher\\EventDispatcher');
// Setup default configurations for the GoogleMoviesClient Client
$this->app->singleton('GoogleMoviesClient\\Client', function () {
$config = $this->provider->config();
$options = $config['options'];
// Use an Event Dispatcher that uses the Laravel event dispatcher
$options['event_dispatcher'] = $this->app->make('GoogleMoviesClient\\Laravel\\Adapters\\EventDispatcherAdapter');
return new Client($options);
});
}
开发者ID:okaufmann,项目名称:google-movies-client-laravel,代码行数:20,代码来源:GoogleMoviesClientServiceProvider.php
示例2: register
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
// Configure any bindings that are version dependent
$this->provider->register();
// Let the IoC container be able to make a Symfony event dispatcher
$this->app->bind('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface', 'Symfony\\Component\\EventDispatcher\\EventDispatcher');
// Setup default configurations for the Tmdb Client
$this->app->singleton('Tmdb\\Client', function () {
$config = $this->provider->config();
$options = $config['options'];
// Use an Event Dispatcher that uses the Laravel event dispatcher
$options['event_dispatcher'] = $this->app->make('Tmdb\\Laravel\\Adapters\\EventDispatcherAdapter');
// Register the client using the key and options from config
$token = new ApiToken($config['api_key']);
return new Client($token, $options);
});
// bind the configuration (used by the image helper)
$this->app->bind('Tmdb\\Model\\Configuration', function () {
$configuration = $this->app->make('Tmdb\\Repository\\ConfigurationRepository');
return $configuration->load();
});
}