Get core templates
@return array Core templates found
974008
public static function findCoreTemplates($templates = null, $extension = false)
    {
        $paths = apply_filters('Modularity/CoreTemplatesSearchPaths', array(
            get_stylesheet_directory(),
            get_template_directory()
        ));

        $fileExt = apply_filters('Modularity/CoreTemplatesSearchFileExtension', array(
            '.php',
            '.blade.php'
        ));

        $search = $templates;

        if (is_null($search) || !is_array($search)) {
            return false;
        }

        foreach ($paths as $path) {
            foreach ($search as $pattern) {
                foreach ($fileExt as $ext) {
                    $foundTemplates = array();
                    foreach (glob($path . '/' . $pattern . $ext) as $found) {
                        $basename = str_replace(array('.blade.php', '.php'), '', basename($found));

                        if ($extension) {
                            return basename($found);
                        } else {
                            return str_replace(array('.blade.php', '.php'), '', basename($found));
                        }
                    }
                }
            }
        }

        return false;
    }
139145
public function template_hierarchy( $templates ) {

		$this->type = substr( current_filter(), 0, - 19 ); // Trim '_template_hierarchy' from end.

		$twig_templates = [];

		foreach ( $templates as $php_template ) {
			if ( '.php' === substr( $php_template, - 4 ) ) {
				$twig_templates[] = substr( $php_template, 0, - 4 ) . '.twig';
			}
		}

		return array_merge( $twig_templates, $templates );
	}
739042
public function listTemplateFolders()
    {

        $this->setUpTemplate();
        $result = [];
        foreach ($this->templateNamespace as $ns => $paths) {
            foreach ($paths as $path) {
                $path = $this->getRootPath() . "/" . $path;
                if ($ns == "") {
                    $result[] = $path;
                } else {
                    $result[] = ['path' => $path, 'namespace' => $ns];
                }
            }
        }

        return $result;
    }
1194362
protected function getTemplateQtiVariables(){

        $variables = parent::getTemplateQtiVariables();

        $tag = static::$qtiTagName;

        //search existing mathML ns declaration:
        $ns = $this->getXIncludeNamespace();
        if(empty($ns)){
            //add one!
            $relatedItem = $this->getRelatedItem();
            if(!is_null($relatedItem)){
                $ns = 'xi';
                $relatedItem->addNamespace($ns, 'http://www.w3.org/2001/XInclude');
            }
        }
        if(!empty($ns)){
            //proceed to ns addition:
            $tag = $ns.':'.$tag;
        }

        $variables['tag'] = $tag;

        return $variables;
    }
521257
public function getTemplateAccessors() {
		if($this->templateAccessors) return $this->templateAccessors;

		$vars = parent::getTemplateAccessors();

		return $this->templateAccessors = array_merge($vars, array (
			'To',
			'Cc',
			'Bcc',
			'From',
			'Subject',
			'Body',
			'BaseURL',
			'IsEmail'
		));
	}
988269
public function getTemplatesForWebPreView()
    {
        $templates = array();
        $templates = $this->addTemplate($templates, 'Reset Passwort Email', AzineTemplateProvider::FOS_USER_PWD_RESETTING_TEMPLATE);
        $templates = $this->addTemplate($templates, 'Account activation', AzineTemplateProvider::FOS_USER_REGISTRATION_TEMPLATE);
        // override this method to add your own templates
        // $templates =$this->addTemplate($templates, "Some other mail",	ExampleTemplateProvider::SOME_OTHER_MAIL_TEMPLATE);
        // $templates =$this->addTemplate($templates, "VIP Infos",	ExampleTemplateProvider::VIP_INFO_MAIL_TEMPLATE);
        return $templates;
    }
1130524
public function getCoreModules()
    {
        $coreModulesByName = $this->getCoreModulesByName();

        $coreModules = $this->all()->filter(
            function ($module) use ($coreModulesByName) {
                return array_key_exists($module->getLowerName(), $coreModulesByName->toArray());
            });

        return $coreModules->all();
    }
1014926
public static function getCoreTemplates($extension = false)
    {
        $paths = apply_filters('Modularity/CoreTemplatesSearchPaths', array(
            get_stylesheet_directory(),
            get_template_directory()
        ));

        $fileExt = apply_filters('Modularity/CoreTemplatesSearchFileExtension', array(
            '.php',
            '.blade.php'
        ));

        $search = apply_filters(
            'Modularity/CoreTemplatesSearchTemplates',
            array(
                'index',
                'comments',
                'front-page',
                'home',
                'single',
                'single-*',
                'archive',
                'archive-*',
                'page',
                'page-*',
                'category',
                'category-*',
                'author',
                'date',
                'search',
                'attachment',
                'image'
            )
        );

        $templates = array();

        foreach ($paths as $path) {
            foreach ($search as $pattern) {
                foreach ($fileExt as $ext) {
                    $foundTemplates = array();
                    foreach (glob($path . '/' . $pattern . $ext) as $found) {
                        $basename = str_replace(array('.blade.php', '.php'), '', basename($found));

                        if ($extension) {
                            $foundTemplates[$basename] = basename($found);
                        } else {
                            $foundTemplates[$basename] = str_replace(array('.blade.php', '.php'), '', basename($found));
                        }
                    }

                    $templates = array_merge($templates, $foundTemplates);
                }
            }
        }

        $templates = array_unique($templates);

        return $templates;
    }
1348242
public function getTemplate()
    {
        if (!$this->useCaching()) {
            $result = $this->renderTemplate();
        } else {
            $cache = Injector::inst()->get(CacheInterface::class . '.PageSlices');
            if (!$cache->has($this->getCacheKey())) {
                $result = $this->renderTemplate();
                $cache->set($this->getCacheKey(), $result);
            } else {
                $result = $cache->get($this->getCacheKey());
            }
        }

        return $result;
    }
897410
protected function getTemplateData()
    {
        $namespace  = $this->getOptionOrConfig('namespace');
        $routes     = $this->routes->toJSON();
        $absolute   = $this->config->get('laroute.absolute', false);
        $rootUrl    = $this->config->get('app.url', '');
        $prefix		= $this->config->get('laroute.prefix', '');

        return compact('namespace', 'routes', 'absolute', 'rootUrl', 'prefix');
    }
1257446
public function getTemplate() : ?string 
    {
        if ( ! $this->hasTemplate()) {
            $this->setTemplate($this->getDefaultTemplate());
        }
        return $this->template;
    }
1107185
function loadTemplates()
    {
        $result[0] = array();
        $result[1] = array();
        $templates = Templates::getInstance();
        $list = $templates->enum();
        $result[0]= array_values($list);
        $result[1]= array_keys($list);
        return $result;
    }
806353
public function getTemplateInheritors()
    {
        $templateInheritors = [];
        foreach ($this->inheritors as $inheritor) {
            if ($inheritor instanceof self) {
                $templateInheritors[] = $inheritor;
            }
        }

        return $templateInheritors;
    }
1352882
public function getCoreModulesByName()
    {
        $coreModules = $this->config->get('society.core.core.CoreModules');
        $coreModules = array_flip($coreModules);

        return collect($coreModules);
    }
1288388
public function buildTemplate()
    {
        if (!empty($this->template)) {
            return $this->template;
        }

        $columns = [];
        foreach ($this->columnTemplateBuilders as $columnTemplateBuilder) {
            $columns[] = $columnTemplateBuilder->buildTemplate();
        }

        $this->template = [
            'type' => TemplateType::CAROUSEL,
            'columns' => $columns,
        ];

        if ($this->imageAspectRatio) {
            $this->template['imageAspectRatio'] = $this->imageAspectRatio;
        }

        if ($this->imageSize) {
            $this->template['imageSize'] = $this->imageSize;
        }

        return $this->template;
    }
517038
protected function _templates($customTemplate = null, $customTemplateSuffix = null)
    {
        $templates = SSViewer::get_templates_by_class(static::class, $customTemplateSuffix, __CLASS__);
        // Prefer any custom template
        if ($customTemplate) {
            // Prioritise direct template
            array_unshift($templates, $customTemplate);
        }
        return $templates;
    }
714628
public function getListTemplate()
    {
        if (null === $this->listTemplate) {
            $template = rtrim($this->getTemplatePrefix(), '/') . '/' . $this->getListSuffix();
            $this->setListTemplate($template);
        }

        return $this->listTemplate;
    }