Register basic templates.
515997
public function registerBasicTemplates()
    {
        $templates = [
            [
                'name'        => 'add_iblock',
                'path'        => $this->dir.'/add_iblock.template',
                'description' => 'Add iblock',
            ],
            [
                'name'        => 'add_iblock_type',
                'path'        => $this->dir.'/add_iblock_type.template',
                'description' => 'Add iblock type',
            ],
            [
                'name'        => 'add_iblock_element_property',
                'path'        => $this->dir.'/add_iblock_element_property.template',
                'description' => 'Add iblock element property',
                'aliases'     => [
                    'add_iblock_prop',
                    'add_iblock_element_prop',
                    'add_element_prop',
                    'add_element_property',
                ],
            ],
            [
                'name'        => 'add_uf',
                'path'        => $this->dir.'/add_uf.template',
                'description' => 'Add user field (for sections, users e.t.c)',
            ],
            [
                'name'        => 'add_table',
                'path'        => $this->dir.'/add_table.template',
                'description' => 'Create table',
                'aliases'     => [
                    'create_table',
                ],
            ],
            [
                'name'        => 'delete_table',
                'path'        => $this->dir.'/delete_table.template',
                'description' => 'Drop table',
                'aliases'     => [
                    'drop_table',
                ],
            ],
            [
                'name'        => 'query',
                'path'        => $this->dir.'/query.template',
                'description' => 'Simple database query',
            ],
        ];

        foreach ($templates as $template) {
            $this->registerTemplate($template);
        }
    }
990619
def render_template(self):
        """"""
        self._parse_paths()
        context = dict(napp=self._napp.__dict__, paths=self._paths)
        self._save(context)
719736
def load_entry_point_group_templates(self, entry_point_group_templates):
        """"""
        result = []
        for ep in iter_entry_points(group=entry_point_group_templates):
            with self.app.app_context():
                for template_dir in ep.load()():
                    result.append(self.register_templates(template_dir))
        return result
742797
protected function register()
    {
        // Make posttype model for the factory.
        $this->setModel($this->makePosttypeModel());

        // Build posttype with model.
        $this->setSingularity($this->makePosttypeInstance());

        // Set columns to the posttype, after admin init.
        if ($this->methodExist('columns')) {
            $this->registerColumns();
        }

        // Set posttype post templates.
        if ($this->methodExist('templates')) {
            $this->registerTemplates();
        }
    }
50246
public function registerNamespaces()
    {
        foreach ($this->all() as $theme) {
            foreach (array('views', 'lang') as $hint) {
                $this->{$hint}->addNamespace($theme->getLowerName(), $theme->getPath($hint));
            }

            $theme->boot();
        }
    }
1349389
protected function registerBaseServices()
    {
        $widget = $this->app->make('antares.widget');
        $this->app->instance('antares.platform.menu', $widget->make('menu.antares'));
        $this->app->instance('antares.platform.acl', $this->app->make('antares.acl')->make('antares'));
        $this->app->instance('app.menu', $widget->make('menu.app'));
    }
918146
public function registerAssets()
    {
        $view = $this->getView();
        FancytreeAsset::register($view);
        $id = 'fancyree_' . $this->id;

        if (isset($this->options['id'])) {
            $id = $this->options['id'];
            unset($this->options['id']);
        } else {
           echo Html::tag('div', '', ['id' => $id]);
        }

        $options = Json::encode($this->options);
        $view->registerJs("\n\$(\"#{$id}\").fancytree({$options});\n");
    }
767319
protected function registerPaths()
    {
        $config = $this->config;

        // Priority (1)
        $this->addPath(
            realpath($config->get('path.templates')),
            PriorityQueue::LOW - 20
        );

        // Priority (2)
        $this->addPath(
            realpath(__DIR__ . '/../Resources/Templates'),
            PriorityQueue::LOW - 30
        );

        return $this;
    }
1131056
public function register() {

		$this->app->singleton( TemplateHierarchy::class, Hierarchy::class );

		$this->app->alias( TemplateHierarchy::class, 'template/hierarchy' );
	}
1040440
protected function registerTemplates()
    {
        $this->hook->filter("theme_{$this->slug}_templates", function ($templates) {
            return array_merge($templates, $this->templates());
        })->dispatch();
    }
1314537
function setupTemplates() {
  
  // Reset templates before proceeding
  // NOTE: This is needed for templates to be copatible with hot code loading
  this.templates = {};

  var self = this;
  var tplDir = app.mvcpath + app.paths.templates;
  var multiSlashes = this.regex.multipleSlashes;
  
  if (fs.existsSync(tplDir) && fs.statSync(tplDir).isDirectory()) {
    
    var files = protos.util.walkDir(tplDir, this.regex.templateFile);
  
    files.forEach(function(path) {
      buildTemplatePartial.call(this, path);
      watchPartial.call(this, path, buildTemplatePartial);
    }, this);
    
  }
  
  this.emit('templates_loaded', this.templates);
  
}
662299
protected function registerAssets()
    {
        $view = $this->getView();
        BxSliderAsset::register($view);
        $js = '$("#' . $this->containerOptions['id'] . '").bxSlider(' . $this->getPluginOptions() . ');';
        $view->registerJs($js, $view::POS_END);

    }
99754
public function create()
	{
		// Register all tinyMCE template files
		if (!array_key_exists($this->rteTemplate, TemplateLoader::getFiles()))
		{
			$objFilesystem = new Filesystem();

			$arrTemplateFiles = glob(TL_ROOT . '/templates/*/be_tinyMCE*');
			
			foreach ($arrTemplateFiles as $strFile)
			{
				$arrTemplates[basename($strFile, '.html5')] = rtrim($objFilesystem->makePathRelative(dirname($strFile), TL_ROOT), '/');
			}
			
			if ($arrTemplates !== null)
			{
				TemplateLoader::addFiles($arrTemplates);
			}
		}

		$this->generateDCA('text', array
		(
			'inputType' 	=>	'textarea',
			'label'			=>	array($this->label, $this->description),
			'eval'			=>	array
			(
				'mandatory'		=>	($this->mandatory) ? true : false, 
				'tl_class'		=> 	'clr',
				'rte'			=>	(array_key_exists($this->rteTemplate, TemplateLoader::getFiles())) ? substr($this->rteTemplate, 3) : 'tinyMCE',
				'preserveTags'	=>	true,
			)
		));
	}
1357273
def _register_template(cls, template_bytes):
    ''''''

    # This implementation won't work if there are nested templates, but
    # we can't do that anyways due to PyGObject limitations so it's ok

    if not hasattr(cls, 'set_template'):
        raise TypeError("Requires PyGObject 3.13.2 or greater")

    cls.set_template(template_bytes)

    bound_methods = set()
    bound_widgets = set()

    # Walk the class, find marked callbacks and child attributes
    for name in dir(cls):
        o = getattr(cls, name, None)

        if inspect.ismethod(o):
            if hasattr(o, '_gtk_callback'):
                bound_methods.add(name)
                # Don't need to call this, as connect_func always gets called
                #cls.bind_template_callback_full(name, o)
        elif isinstance(o, _Child):
            cls.bind_template_child_full(name, True, 0)
            bound_widgets.add(name)

    # Have to setup a special connect function to connect at template init
    # because the methods are not bound yet
    cls.set_connect_func(_connect_func, cls)

    cls.__gtemplate_methods__ = bound_methods
    cls.__gtemplate_widgets__ = bound_widgets

    base_init_template = cls.init_template
    cls.init_template = lambda s: _init_template(s, cls, base_init_template)
964126
public function registerClientLib()
    {
        $jsPath = trim(Template::js('', $this->extension->getId()), '/');
        ClientLibRegistry::getRegistry()->register($this->extension->getId(), $jsPath);

        $cssPath = trim(Template::css('', $this->extension->getId()), '/');
        ClientLibRegistry::getRegistry()->register($this->extension->getId().'Css', $cssPath);
    }
155203
def register_blueprints(app, application_package_name=None, blueprint_directory=None):
    """"""
    if not application_package_name:
        application_package_name = 'app'

    if not blueprint_directory:
        blueprint_directory = os.path.join(os.getcwd(), application_package_name)

    blueprint_directories = get_child_directories(blueprint_directory)

    for directory in blueprint_directories:
        abs_package = '{}.{}'.format(application_package_name, directory)

        service = importlib.import_module(abs_package)
        app.register_blueprint(service.blueprint_api, url_prefix='')
912206
def main(args=None):
    """"""
    if args is None:
        parser = create_parser()
        args = parser.parse_args()

    if args.debug:
        logging.basicConfig(level=logging.DEBUG)
    else:
        logging.basicConfig(level=logging.INFO)

    input_module = input_mapping[args.input_reader]
    output_module = output_mapping[args.output_format]

    templates = []
    # Load templates from external folder if set.
    if args.template_folder:
        templates += read_templates(os.path.abspath(args.template_folder))

    # Load internal templates, if not disabled.
    if not args.exclude_built_in_templates:
        templates += read_templates()
    output = []
    for f in args.input_files:
        res = extract_data(f.name, templates=templates, input_module=input_module)
        if res:
            logger.info(res)
            output.append(res)
            if args.copy:
                filename = args.filename.format(
                    date=res['date'].strftime('%Y-%m-%d'),
                    invoice_number=res['invoice_number'],
                    desc=res['desc'],
                )
                shutil.copyfile(f.name, join(args.copy, filename))
            if args.move:
                filename = args.filename.format(
                    date=res['date'].strftime('%Y-%m-%d'),
                    invoice_number=res['invoice_number'],
                    desc=res['desc'],
                )
                shutil.move(f.name, join(args.move, filename))
        f.close()

    if output_module is not None:
        output_module.write_to_file(output, args.output_name)