Get all templates

Can pass in template_type to filter templates.

@param string  $template_type

@return array
971766
public function listTemplates( $templateType = null ){
        $queryParams = is_null( $templateType ) ? [] : [ 'type' => $templateType ];
        return $this->httpGet( self::PATH_TEMPLATE_LIST, $queryParams );
    }
610603
private function _readTemplate($templateFile) {
		$filename = PHPCHECKSTYLE_HOME_DIR . "/html/template/" . $templateFile . ".tmpl";
		$handle = fopen($filename, "r");
		$contents = fread($handle, filesize($filename));
		fclose($handle);

		return $contents;
	}
1069221
public static function getConfigByType($type)
	{
		$configPath = null;

		try {
			$templatePaths = CustomTemplate::getTemplates($type);
			if (!empty($templatePaths[0])) {
				$configPath = substr($templatePaths[0], 0, -6) . '_config.php';
			}
		}
		catch (\Exception $e) {
			$configPath = null;
		}

		if ($configPath === null || !file_exists($configPath)) {
			$allConfigs = array_merge(
				glob(TL_ROOT . '/templates/' . $type . '_config.php') ?: array(),
				glob(TL_ROOT . '/templates/*/' . $type . '_config.php') ?: array()
			);
			if (count($allConfigs)) {
				$configPath = $allConfigs[0];
			}
			else {
				return;
			}
		}

		$config = include $configPath;

		if ($config) {
			$config['fields'] = is_array($config['fields']) ? $config['fields'] : array();
		}

		return $config;
	}
1341914
public function getTemplatesToGenerate()
    {
        return parent::getTemplatesToGenerate() + array(
            'EditBuilderTemplate'.self::TWIG_EXTENSION
                => 'Resources/views/'.$this->getBaseGeneratorName().'New/index.html.twig',
            'Edit/FormBuilderTemplate'.self::TWIG_EXTENSION
                => 'Resources/views/'.$this->getBaseGeneratorName().'New/form.html.twig',
        );
    }
1056372
def get_templates(self):
        
        use = getattr(self, 'use', '')
        if isinstance(use, list):
            return [n.strip() for n in use if n.strip()]

        return [n.strip() for n in use.split(',') if n.strip()]
1366228
private function getTemplateList()
    {
        $templates = $this->getAvailableTemplates($this->bundle);

        $types = array();
        foreach ($templates as $key => $template) {
            $types[$key] = $template['name'];
        }

        return $types;
    }
580939
public function serialize(TemplateType $templateType)
    {
        $serialized = [
            'id' => $templateType->getUuid(),
            'name' => $templateType->getName(),
            'placeholders' => $templateType->getPlaceholders(),
            'defaultTemplate' => $templateType->getDefaultTemplate(),
        ];

        return $serialized;
    }
681617
public function GetTemplateFiles()
	{
		$files = array();
		
		list($nothing,$data) = explode("[files]", $this->GetConfigFileContents(),2);
		
		if ($data)
		{
			$lines = explode("\n",$data);
			
			foreach ($lines as $line)
			{
				if ($line) $files[] = new TemplateFile($line);
			}
		}
		
		return $files;
	}
166364
public static function listAllTemplates()
    {
        $fileTemplates = (array) MailManager::instance()->listRegisteredTemplates();
        $dbTemplates = (array) self::lists('code', 'code');
        $templates = $fileTemplates + $dbTemplates;
        ksort($templates);
        return $templates;
    }
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;
    }
128424
public function keepDefaultTemplates($templatesToKeep)
  {
    add_filter('vc_load_default_templates', function ($templates) use ($templatesToKeep) {
      $returnArray = [];
      if (is_array($templatesToKeep) && count($templatesToKeep) > 0) {
        $returnArray = array_filter($templates, function ($var) use ($templatesToKeep) {
          return in_array($var['custom_class'], $templatesToKeep);
        });
      }

      return $returnArray;
    });
  }
472229
public static function get_page_templates() {
		static $wrappers = [];
		if ( $wrappers ) {
			return $wrappers;
		}

		$page_templates = new Model\Page_Templates();
		$wrappers = $page_templates->get();
		return $wrappers;
	}
321735
public static function allTemplates()
    {
        $result = [];
        $codes = array_keys(self::listAllTemplates());

        foreach ($codes as $code) {
            $result[] = self::findOrMakeTemplate($code);
        }

        return $result;
    }
309315
public static function selectTemplateList(
        $templateState
    ) {
        $templateState = (object) $templateState;

        $templateList = [];
        foreach ($templateState->template as $templateKey => $templateItem) {
            $templateList[$templateKey] = $templateItem;
        }

        return $templateList;
    }
535583
public static function get_top_level_templates()
	{

		$ss_templates_array = array();
		$current_theme_path = THEMES_PATH.'/'.Config::inst()->get('SSViewer', 'theme');

		//theme directories to search
		$search_dir_array = array(
			MAINTENANCE_MODE_PATH.'/templates',
			$current_theme_path.'/templates'
		);

		foreach ($search_dir_array as $directory) {

			//Get all the SS templates in the directory
			foreach (glob("{$directory}/*.ss") as $template_path) {

				//get the template name from the path excluding the ".ss" extension
				$template = basename($template_path, '.ss');

				//Add the key=>value pair to the ss_template_array
				$ss_templates_array[$template] = $template;
			}

		}

		return $ss_templates_array;

	}
293448
def templates(self):
        
        if self._template_manager is None:
            self._template_manager = TemplateManager(session=self._session)
        return self._template_manager
591287
protected function _getTemplate()
    {
        if (is_null($this->_template)) {
            foreach ($this->_map as $method => $className) {
                if ($this->_sql instanceof $className) {
                    $this->_template = $this->$method();
                    break;
                }
            }
        }
        return $this->_template;
    }