當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Container::flush方法代碼示例

本文整理匯總了PHP中Pimple\Container::flush方法的典型用法代碼示例。如果您正苦於以下問題:PHP Container::flush方法的具體用法?PHP Container::flush怎麽用?PHP Container::flush使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Pimple\Container的用法示例。


在下文中一共展示了Container::flush方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: register

 public function register(Container $app)
 {
     $app['router.options'] = [];
     $app['router.loader_resolver'] = function () {
         $fileLocator = new FileLocator();
         $loaderResolver = new LoaderResolver([new XmlFileLoader($fileLocator), new PhpFileLoader($fileLocator), new ClosureLoader()]);
         if (class_exists('Symfony\\Component\\Yaml\\Parser')) {
             $loaderResolver->addLoader(new YamlFileLoader($fileLocator));
         }
         return $loaderResolver;
     };
     $app['router'] = function (Application $app) {
         $router = new Router(new ClosureLoader(), function () use($app) {
             if (isset($app['router.resource'])) {
                 $userLoader = new DelegatingLoader($app['router.loader_resolver']);
                 $userRoutes = $userLoader->load($app['router.resource']);
                 $app['routes']->addCollection($userRoutes);
             }
             $app->flush();
             return $app['routes'];
         }, $app['router.options'] + ['debug' => isset($app['debug']) ? $app['debug'] : false, 'matcher_base_class' => 'Silex\\Provider\\Routing\\RedirectableUrlMatcher', 'matcher_class' => 'Silex\\Provider\\Routing\\RedirectableUrlMatcher'], $app['request_context'], $app['logger']);
         return $router;
     };
     $app['request_matcher'] = function (Application $app) {
         return $app['router'];
     };
     $app['url_generator'] = function (Application $app) {
         return $app['router'];
     };
 }
開發者ID:matthecat,項目名稱:silex-routing-provider,代碼行數:30,代碼來源:RoutingServiceProvider.php

示例2: register

 public function register(Container $app)
 {
     $app['controllers_factory'] = function () use($app) {
         return new I18nControllerCollection($app['route_factory'], $app['locale'], $app['i18n_routing.locales']);
     };
     $app['url_generator'] = function ($app) {
         $app->flush();
         return new I18nUrlGenerator($app['routes'], $app['request_context']);
     };
     $app['i18n_routing.locales'] = array('en');
 }
開發者ID:ehibes,項目名稱:silexI18nRoutingServiceProvider,代碼行數:11,代碼來源:I18nRoutingServiceProvider.php

示例3: register

 public function register(Container $app)
 {
     $app['controllers_factory'] = function () use($app) {
         return new I18nControllerCollection($app['route_factory'], $app['locale'], $app['i18n_routing.locales'], $app['translator'], $app['i18n_routing.translation_domain'], $app['i18n_routing.allow_localized_default']);
     };
     $app['url_generator'] = function ($app) {
         $app->flush();
         return new I18nUrlGenerator($app['routes'], $app['request_context']);
     };
     $app['i18n_routing.locales'] = array('en');
     $app['i18n_routing.translation_domain'] = 'routes';
     $app['i18n_routing.allow_localized_default'] = false;
 }
開發者ID:raphaelvigee,項目名稱:I18nRoutingServiceProvider,代碼行數:13,代碼來源:I18nRoutingServiceProvider.php


注:本文中的Pimple\Container::flush方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。