Register new blade extensions.
776020
protected function registerBladeExtensions()
    {
        if (false === $this->app['config']->get('defender.template_helpers', true)) {
            return;
        }

        $this->app->afterResolving('blade.compiler', function (BladeCompiler $bladeCompiler) {
            /*
             * add @shield and @endshield to blade compiler
             */
            $bladeCompiler->directive('shield', function ($expression) {
                return "<?php if(app('defender')->canDo({$this->stripParentheses($expression)})): ?>";
            });

            $bladeCompiler->directive('endshield', function ($expression) {
                return '<?php endif; ?>';
            });

            /*
             * add @is and @endis to blade compiler
             */
            $bladeCompiler->directive('is', function ($expression) {
                return "<?php if(app('defender')->hasRoles({$this->stripParentheses($expression)})): ?>";
            });

            $bladeCompiler->directive('endis', function ($expression) {
                return '<?php endif; ?>';
            });

            /*
             * add @isnot and @endisnot to blade compiler
             */
            $bladeCompiler->directive('isnot', function ($expression) {
                return "<?php if(!app('defender')->hasRoles({$this->stripParentheses($expression)})): ?>";
            });

            $bladeCompiler->directive('endisnot', function ($expression) {
                return '<?php endif; ?>';
            });
        });
    }
990182
def register_previewer(self, name, previewer):
        """"""
        if name in self.previewers:
            assert name not in self.previewers, \
                "Previewer with same name already registered"
        self.previewers[name] = previewer
        if hasattr(previewer, 'previewable_extensions'):
            self._previewable_extensions |= set(
                previewer.previewable_extensions)
834876
protected function addBladeDirectives()
    {
        $this->app->afterResolving('blade.compiler', function (BladeCompiler $bladeCompiler) {
            $bladeCompiler->directive('meta', function ($arguments) {
                return "<?php echo Meta::tag($arguments); ?>";
            });

            $bladeCompiler->directive('metas', function ($arguments) {
                return "<?php echo Meta::tags($arguments); ?>";
            });
        });
    }
24510
public void registerExtensions(final Class<?>... extensions) {
        for (Class<?> extension : extensions) {
            register(ConfigItem.Extension, extension);
        }
    }
24141
protected function registerAdditionalProviders()
    {
        foreach ($this->providers as $provider) {
            if (class_exists($provider)) {
                $this->app->register($provider);
            }
        }
    }
707090
public function registerStandardObjects()
	{
		$this->extensionMap = new ExtensionMap();
		$this->extensions = $this->extensionMap->getRegisteredExtensionNames();
		$this->finder->files();
	}
856634
protected function registerSidebarItems()
    {
        foreach ($this->filesystem()->glob($this->getSidebarFolder().DS.'*.php') as $path) {
            $this->mergeConfigFrom($path, $this->getSidebarKey().'.'.basename($path, '.php'));
        }
    }
845309
protected function registerBladeDirectives()
    {
        Blade::directive('form', function ($expression) {
            $expression = $this->addParenthesis($expression); 
            return "<?php app('Activisme_BE')->model{$expression}; ?>"; 
        });

        Blade::directive('input', function ($expression) {
            $expression = $this->addParenthesis($expression);
            return "<?php echo app('Activisme_BE')->input{$expression}; ?>";
        });

        Blade::directive('text', function ($expression) {
            $expression = $this->addParenthesis($expression);
            return "<?php echo app('Activisme_BE')->text{$expression}; ?>";
        });

        Blade::directive('checkbox', function ($expression) {
            $expression = $this->addParenthesis($expression);
            return "<?php echo app('Activisme_BE')->checkbox{$expression}; ?>";
        });

        Blade::directive('radio', function ($expression) {
            $expression = $this->addParenthesis($expression);
            return "<?php echo app('Activisme_BE')->radio{$expression}; ?>";
        });

        Blade::directive('options', function ($expression) {
            $expression = $this->addParenthesis($expression);
            return "<?php echo app('Activisme_BE')->options{$expression}; ?>";
        });

        Blade::directive('error', function ($expression) {
            $expression = $this->addParenthesis($expression);
            return "<?php echo app('Activisme_BE')->error{$expression}; ?>";
        });
    }
813509
public void registerCoreExtensions() {
    if (extensionsRegistered) {
      throw H2O.fail("Extensions already registered");
    }

    long before = System.currentTimeMillis();
    ServiceLoader<AbstractH2OExtension> extensionsLoader = ServiceLoader.load(AbstractH2OExtension.class);
    for (AbstractH2OExtension ext : extensionsLoader) {
      if (isEnabled(ext)) {
        ext.init();
        coreExtensions.put(ext.getExtensionName(), ext);
      }
    }
    extensionsRegistered = true;
    registerCoreExtensionsMillis = System.currentTimeMillis() - before;
  }
907295
protected function registerEngineResolverExtensions()
    {
        $this->app->extend('view.engine.resolver', function ($resolver, $app) {
            $this->registerBladeEngine($resolver);

            $this->registerHandlebarsEngine($resolver);

            return $resolver;
        });
    }
677927
protected function registerExtensions()
    {
        // Bind extension manager as singleton,
        // so user can call it and add own extensions
        $this->app->singleton(ExtensionManager::class, function ($app) {

            $manager = new ExtensionManager(
                $this->app[ManagerRegistry::class],
                $this->app[Dispatcher::class]
            );

            if ($this->config['gedmo_extensions']['enabled']) {
                $manager->enableGedmoExtensions(
                    $this->config['meta']['namespaces'],
                    $this->config['gedmo_extensions']['all_mappings']
                );
            }

            // Register the extensions
            foreach ($this->config['extensions'] as $extension) {
                if (!class_exists($extension)) {
                    throw new ExtensionNotFound("Extension {$extension} not found");
                }

                $manager->register(
                    $app->make($extension)
                );
            }

            return $manager;
        });
    }
197084
protected function registerBladeExtensions()
    {
        // Potion asset url
        \Blade::extend(function($view, $compiler)
        {
            $pattern = $this->createBladeMatcher('potion_asset_url');
            return preg_replace($pattern, '$1<?php echo(\ClassyGeeks\Potion\BladeHelpers::assetUrl$2); ?>', $view);
        });

        // Potion Css
        \Blade::extend(function($view, $compiler)
        {
            $pattern = $this->createBladeMatcher('potion_asset_css');
            return preg_replace($pattern, '$1<?php echo(\ClassyGeeks\Potion\BladeHelpers::assetCss$2); ?>', $view);
        });

        // Potion Js
        \Blade::extend(function($view, $compiler)
        {
            $pattern = $this->createBladeMatcher('potion_asset_js');
            return preg_replace($pattern, '$1<?php echo(\ClassyGeeks\Potion\BladeHelpers::assetJs$2); ?>', $view);
        });

        // Potion Img
        \Blade::extend(function($view, $compiler)
        {
            $pattern = $this->createBladeMatcher('potion_asset_img');
            return preg_replace($pattern, '$1<?php echo(\ClassyGeeks\Potion\BladeHelpers::assetImg$2); ?>', $view);
        });
    }
782543
public function boot()
    {
        $this->setupConfig();

        if ($this->shouldRegisterBladeDirective()) {
            BladeUtils::registerBladeDirective(
                $this->app['view']->getEngineResolver()->resolve('blade')->getCompiler()
            );
        }
    }
891803
public function registerHamlBladeCompiler() {

		// Add resolver
		$this->app['view.engine.resolver']->register('haml.blade', function() {
			return new CompilerEngine($this->app['Bkwld\LaravelHaml\HamlBladeCompiler']);
		});

		// Add extensions
		$this->app['view']->addExtension('haml.blade', 'haml.blade');
		$this->app['view']->addExtension('haml.blade.php', 'haml.blade');
	}
66528
def register(self, extensions):
        """"""
        for ext in reversed(extensions):
            for name in ext.names:
                try:
                    self._extensions[name].appendleft(ext)
                except KeyError:
                    self._extensions[name] = deque([ext])
964717
private function registerServiceProviders()
    {
        $this->app->register( ArboryTranslationServiceProvider::class );
        $this->app->register( TranslatableServiceProvider::class );
        $this->app->register( ArboryFileServiceProvider::class );
        $this->app->register( ArboryAuthServiceProvider::class );
        $this->app->register( GlideImageServiceProvider::class );
        $this->app->register( AssetServiceProvider::class );
        $this->app->register( SettingsServiceProvider::class );
        $this->app->register( ExcelServiceProvider::class );
        $this->app->register( FileManagerServiceProvider::class );
    }
769657
protected function registerBladeMinifier()
    {
        $this->app->singleton('htmlmin.blade', function (Container $app) {
            $force = $app->config->get('htmlmin.force', false);

            return new BladeMinifier($force);
        });

        $this->app->alias('htmlmin.blade', BladeMinifier::class);
    }