protected function renderTemplate($templateName, array $variables = [])
    {
        $templatePath = __DIR__ . '/../../../stub/' . $templateName;
        if (!file_exists($templatePath)) {
            throw new DbExporterException('Template ' . $templateName . ' not found');
        }

        $template = file_get_contents($templatePath);

        $search  = array_keys($variables);
        $replace = array_values($variables);

        foreach ($search as &$item) {
            $item = '{{' . $item . '}}';
        }

        return str_replace($search, $replace, $template);
    }
protected function renderTemplate($templateName, array $variables = [])
    {
        $templatePath = __DIR__ . '/../../../stub/' . $templateName;
        if (!file_exists($templatePath)) {
            throw new DbExporterException('Template ' . $templateName . ' not found');
        }

        $template = file_get_contents($templatePath);

        $search  = array_keys($variables);
        $replace = array_values($variables);

        foreach ($search as &$item) {
            $item = '{{' . $item . '}}';
        }

        return str_replace($search, $replace, $template);
    }
protected function renderTemplate ( $ templateName , array $ variables = [ ] ) { $ templatePath = __DIR__ . '/../../../stub/' . $ templateName ; if ( ! file_exists ( $ templatePath ) ) { throw new DbExporterException ( 'Template ' . $ templateName . ' not found' ) ; } $ template = file_get_contents ( $ templatePath ) ; $ search = array_keys ( $ variables ) ; $ replace = array_values ( $ variables ) ; foreach ( $ search as & $ item ) { $ item = '{{' . $ item . '}}' ; } return str_replace ( $ search , $ replace , $ template ) ; }
Get rendered template

@param string $templateName template file name
@param array  $variables    array of template variables (key value pairs)

@return string

@throws \ViKon\DbExporter\Exception\DbExporterException
Get rendered template