当前位置: 首页>>代码示例>>PHP>>正文


PHP Factory::addNamespace方法代码示例

本文整理汇总了PHP中Illuminate\Contracts\View\Factory::addNamespace方法的典型用法代码示例。如果您正苦于以下问题:PHP Factory::addNamespace方法的具体用法?PHP Factory::addNamespace怎么用?PHP Factory::addNamespace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Contracts\View\Factory的用法示例。


在下文中一共展示了Factory::addNamespace方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * construct.
  *
  * @param \Illuminate\Contracts\Mail\Mailer  $mailer
  * @param \Illuminate\Filesystem\Filesystem  $filesystem
  * @param \Illuminate\Contracts\View\Factory $viewFactory
  */
 public function __construct(MailerContract $mailer, Filesystem $filesystem, ViewFactory $viewFactory)
 {
     $this->mailer = $mailer;
     $this->filesystem = $filesystem;
     $this->viewFactory = $viewFactory;
     $this->viewFactory->addNamespace($this->viewNamespace, $this->storagePath());
 }
开发者ID:recca0120,项目名称:laravel-email-template,代码行数:14,代码来源:Mailer.php

示例2: boot

 /**
  * Bootstrap the application services.
  */
 public function boot(Router $router, ViewFactory $view)
 {
     $view->addNamespace('admin', resource_path('views/admin'));
     // route model binding for admin routes
     $router->model('content_page', Page::class);
     $this->bootAdminRoutes($router);
 }
开发者ID:unstoppablecarl,项目名称:laravel-content-pages-example,代码行数:10,代码来源:PagesServiceProvider.php

示例3: boot

 /**
  * boot.
  *
  * @method boot
  *
  * @param \Illuminate\Contracts\View\Factory $viewFactory
  * @param \Illuminate\Routing\Router         $router
  */
 public function boot(ViewFactory $viewFactory, Router $router)
 {
     $viewFactory->addNamespace('payum', __DIR__ . '/../resources/views');
     $config = $this->app['config']['payum'];
     $this->handleRoutes($router, $config);
     if ($this->app->runningInConsole() === true) {
         $this->handlePublishes();
     }
 }
开发者ID:recca0120,项目名称:laravel-payum,代码行数:17,代码来源:LaravelPayumServiceProvider.php

示例4: register

 /**
  * Register an addon.
  *
  * @param $path
  * @param $enabled
  * @param $installed
  */
 public function register($path, array $enabled, array $installed)
 {
     if (!is_dir($path)) {
         return;
     }
     $vendor = strtolower(basename(dirname($path)));
     $slug = strtolower(substr(basename($path), 0, strpos(basename($path), '-')));
     $type = strtolower(substr(basename($path), strpos(basename($path), '-') + 1));
     $class = studly_case($vendor) . '\\' . studly_case($slug) . studly_case($type) . '\\' . studly_case($slug) . studly_case($type);
     /* @var Addon|Module|Extension|Twig_ExtensionInterface $addon */
     $addon = app($class)->setPath($path)->setType($type)->setSlug($slug)->setVendor($vendor);
     // If the addon supports states - set the state now.
     if ($addon->getType() === 'module' || $addon->getType() === 'extension') {
         $addon->setInstalled(in_array($addon->getNamespace(), $installed));
         $addon->setEnabled(in_array($addon->getNamespace(), $enabled));
     }
     // Bind to the service container.
     $this->container->alias($addon->getNamespace(), $alias = get_class($addon));
     $this->container->instance($alias, $addon);
     // Load package configuration.
     $this->configurator->addNamespace($addon->getNamespace(), $addon->getPath('resources/config'));
     // Load system overrides.
     $this->configurator->addNamespaceOverrides($addon->getNamespace(), base_path('resources/addons/' . $addon->getVendor() . '/' . $addon->getSlug() . '-' . $addon->getType()));
     // Load application overrides.
     $this->configurator->addNamespaceOverrides($addon->getNamespace(), $this->application->getResourcesPath('addons/' . $addon->getVendor() . '/' . $addon->getSlug() . '-' . $addon->getType() . '/config'));
     // Continue loading things.
     $this->provider->register($addon);
     // Add the view / translation namespaces.
     $this->views->addNamespace($addon->getNamespace(), $addon->getPath('resources/views'));
     $this->translator->addNamespace($addon->getNamespace(), $addon->getPath('resources/lang'));
     /*
      * If the addon is a plugin then
      * load it into Twig when appropriate.
      */
     if ($addon->getType() === 'plugin') {
         $this->events->listen('Anomaly\\Streams\\Platform\\View\\Event\\RegisteringTwigPlugins', function (RegisteringTwigPlugins $event) use($addon) {
             $twig = $event->getTwig();
             $twig->addExtension($addon);
         });
     }
     $this->collection->put($addon->getNamespace(), $addon);
     $this->events->fire(new AddonWasRegistered($addon));
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:50,代码来源:AddonIntegrator.php

示例5: handle

 /**
  * Detect the active theme and set up
  * our environment with it.
  */
 public function handle()
 {
     $admin = $this->themes->get($this->config->get('streams::themes.admin'));
     $standard = $this->themes->get($this->config->get('streams::themes.standard'));
     if ($admin) {
         $admin->setActive(true);
     }
     if ($standard) {
         $standard->setActive(true);
     }
     if ($admin && in_array($this->request->segment(1), ['installer', 'admin'])) {
         $admin->setCurrent(true);
     } elseif ($standard) {
         $standard->setCurrent(true);
     }
     if ($theme = $this->themes->current()) {
         $this->view->addNamespace('theme', $theme->getPath('resources/views'));
         $this->translator->addNamespace('theme', $theme->getPath('resources/lang'));
         $this->asset->addPath('theme', $theme->getPath('resources'));
         $this->image->addPath('theme', $theme->getPath('resources'));
     }
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:26,代码来源:LoadCurrentTheme.php

示例6: registerViewNamespace

 /**
  * 플러그인의 view namespace를 지정한다.
  *
  * @param PluginEntity $entity 플러그인
  *
  * @return void
  */
 private function registerViewNamespace(PluginEntity $entity)
 {
     $this->viewFactory->addNamespace($entity->getId(), $this->pluginsDir . '/' . $entity->getId());
 }
开发者ID:xpressengine,项目名称:xpressengine,代码行数:11,代码来源:PluginHandler.php

示例7: __construct

 /**
  * @param Factory $viewFactory
  */
 public function __construct(Factory $viewFactory)
 {
     $this->viewFactory = $viewFactory;
     $this->viewFactory->addNamespace('mitchell', realpath(__DIR__ . '/templates/mitchell'));
     $this->viewFactory->addNamespace('laraveldoctrine', realpath(__DIR__ . '/templates/laraveldoctrine'));
 }
开发者ID:Devitek,项目名称:orm,代码行数:9,代码来源:MitchellMigrator.php

示例8: setupPaginationEnvironment

 /**
  * Setup the pagination environment.
  *
  * @return void
  */
 protected function setupPaginationEnvironment()
 {
     $this->view->addNamespace('pagination', __DIR__ . '/views');
 }
开发者ID:AlexCutts,项目名称:framework,代码行数:9,代码来源:Factory.php


注:本文中的Illuminate\Contracts\View\Factory::addNamespace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。