Set Template Extension file

@param string $extension
6833
public function setTemplateExtension($extension)
    {
        $extension = (string) $extension;
        $extension = trim($extension);
        if ('.' == $extension[0]) {
            $extension = substr($extension, 1);
        }

        $this->extension = $extension;
    }
889023
public function addExtension($extension)
    {
        if (($index = array_search($extension, $this->extensions)) !== false) {
            unset($this->extensions[$index]);
        }

        array_unshift($this->extensions, $extension);
    }
1051655
protected function setStats($extension, $stat)
    {
        if (isset($this->stats[$extension])) {
            $this->stats[$extension]['files'] += $stat['files'];
            $this->stats[$extension]['blank'] += $stat['blank'];
            $this->stats[$extension]['comment'] += $stat['comment'];
            $this->stats[$extension]['code'] += $stat['code'];
        } else {
            $this->stats[$extension] = $stat;
        }
    }
886069
@Override
	public void setFileExtension(final String fileExtension) {
		if (fileExtension == null) {
			LOG.warn("Use the default value because SQL template extension is set to NULL.");
			LOG.warn("Default SQL template extension[{}]", DEFAULT_FILE_EXTENSION);
			this.fileExtension = DEFAULT_FILE_EXTENSION;
		} else {
			this.fileExtension = fileExtension;
		}
	}
1249542
public function setExtension(string $extension)
    {
        $old = $this->getPath();
        $new = $this->getLocation().DIRECTORY_SEPARATOR.$this->getName();

        if(!empty($extension)) {
            $new .= ".{$extension}";
        }

        if(rename($old, $new)) {
            $this->_extension = $extension;
        }
    }
872214
public function addExtension($extension = null)
    {
        if ($extension == null) {
            return $this->twigEnvironment->addExtension($this->twigDebug());
        }

        return $this->twigEnvironment->addExtension($extension);
    }
1242981
public function addExtensions(Extension ...$extensions): void
    {
        foreach ($extensions as $extension)
        {
            $this->extensions->attach($extension);
        }
    }
559476
public function withExtension($extension)
    {
        $clone = clone $this;
        $clone->info['extension'] = $extension;

        if (empty($clone->info['file'])) {
            $clone->info['file'] = array_pop($clone->info['path']);
        }

        return $clone;
    }
310023
public function AllowFileExtension($Extension) {
      if ($Extension === NULL)
         $this->_AllowedFileExtensions = array();
		elseif (is_array($Extension))
			$this->_AllowedFileExtensions = array_merge($this->_AllowedFileExtensions, $Extension);
		else
			$this->_AllowedFileExtensions[] = $Extension;
	}
218506
public function setTemplateFile($file)
    {
        $this->onRender[] = function() use ($file) {
            $this->getTemplate()->add('gridoTemplate', $this->getTemplate()->getFile());
            $this->getTemplate()->setFile($file);
        };

        return $this;
    }
1254892
public function setTemplate($template)
    {
        if (Format::isUri($template) === true || (gettype($template) === 'string' && empty($template) === true)) {
            $this->template = $template;
        } else {
            $msg = "The given template '${template}' is not a valid URI.";
            throw new InvalidArgumentException($msg);
        }
    }
94991
public function setTypeFromExtension($extension)
    {
        if ( ! $this->checkExtension($extension) ) {
            throw new InvalidFileExtensionException("Invalid File Extension [{$extension}].");
        }

        $this->setSelectedType($extension);

        return $this;
    }
1157457
public static function SetTemplate($sTemplateFilename, $sMasterpageFilename = null){
            $oThis = self::CreateInstanceIfNotExists();
            
            if(is_object($oThis->oSmarty)){
                if(!is_null($sMasterpageFilename)){
                    $sContent = $oThis->oSmarty->fetch($sTemplateFilename);
                    $oThis->oSmarty->assign('template', $sContent); 
                    $oThis->sTemplateFilename = $sMasterpageFilename;
                }
                else{
                    $oThis->sTemplateFilename = $sTemplateFilename;
                }
            }
            else{
                $sTemplate = (file_exists($sTemplateFilename)) ? file_get_contents($sTemplateFilename) : null;
                $sMasterpage = (file_exists($sMasterpageFilename)) ? file_get_contents($sMasterpageFilename) : null;

                if(!is_null($sMasterpage))
                    $oThis->sBuffer = str_replace("{\$template}", $sTemplate, $sMasterpage);
                else
                    $oThis->sBuffer = $sTemplate;

                if(Storage::Get("app.minified") && !Storage::Get("debug"))
                    $oThis->SanitizeOutput($oThis->sBuffer);

                $oThis->IncludeTemplate();
            }
        }
679295
public function addExtension(ExtensionInterface $extension)
    {
        if (!in_array($extension, $this->extensions)) {
            $this->extensions[] = $extension;
            $options = Phug::getExtensionsOptions([$extension]);
            foreach ([$this, $this->getCompiler()] as $instance) {
                $instance->setOptionsRecursive($options);
            }

            $this->initCompiler();
        }
    }
777956
public function set_filename($dataname, $extension = '.csv') {
        $filename = clean_filename($dataname);
        $filename .= clean_filename('-' . gmdate("Ymd_Hi"));
        $filename .= clean_filename("-{$this->delimiter}_separated");
        $filename .= $extension;
        $this->filename = $filename;
    }
1256519
public function setExtensions(array $extensions)
    {
        $this->extensions = [];
        foreach ($extensions as $extension) {
            $this->addExtension($extension);
        }

        return $this;
    }
219128
public function getFilename($extension = '.php')
    {
        // If template is named,
        // return joined template names.
        if ($this->isNamed()) {
            return join('-', $this->file) . $extension;
        }

        // Use first template name, if template
        // file is an array, but is not named.
        if (is_array($this->file) && isset($this->file[0])) {
            return "{$this->file[0]}{$extension}";
        }

        return apply_filters('tonik/gin/template/filename', "{$this->file}{$extension}");
    }