protected function renderTemplate($template)
    {
        // Build allowed extensions
        $allowedExtensions = new ArrayList();
        foreach (File::getAllowedExtensions() as $extension) {
            if ($extension) {
                $allowedExtensions->push(new ArrayData([
                    'Extension' => preg_quote($extension)
                ]));
            }
        }

        Config::nest();
        Config::modify()->set(SSViewer::class, 'source_file_comments', false);

        $viewer = SSViewer::create([$template]);
        $result = (string)$viewer->process(new ArrayData([
            'AllowedExtensions' => $allowedExtensions
        ]));

        Config::unnest();

        return $result;
    }
protected function renderTemplate($template)
    {
        // Build allowed extensions
        $allowedExtensions = new ArrayList();
        foreach (File::getAllowedExtensions() as $extension) {
            if ($extension) {
                $allowedExtensions->push(new ArrayData([
                    'Extension' => preg_quote($extension)
                ]));
            }
        }

        Config::nest();
        Config::modify()->set(SSViewer::class, 'source_file_comments', false);

        $viewer = SSViewer::create([$template]);
        $result = (string)$viewer->process(new ArrayData([
            'AllowedExtensions' => $allowedExtensions
        ]));

        Config::unnest();

        return $result;
    }
protected function renderTemplate ( $ template ) { // Build allowed extensions $ allowedExtensions = new ArrayList ( ) ; foreach ( File :: getAllowedExtensions ( ) as $ extension ) { if ( $ extension ) { $ allowedExtensions -> push ( new ArrayData ( [ 'Extension' => preg_quote ( $ extension ) ] ) ) ; } } Config :: nest ( ) ; Config :: modify ( ) -> set ( SSViewer :: class , 'source_file_comments' , false ) ; $ viewer = SSViewer :: create ( [ $ template ] ) ; $ result = ( string ) $ viewer -> process ( new ArrayData ( [ 'AllowedExtensions' => $ allowedExtensions ] ) ) ; Config :: unnest ( ) ; return $ result ; }
Render server configuration file from a template file

@param string $template
@return string Rendered results
Render server configuration file from a template file