public function writeTemplate($dir)
    {
        // Writes down the file
        $fileDir = $dir . '/' . $this->language->getLanguageName() . $this->baseFolder;
        if (!is_dir($fileDir)) {
            mkdir($fileDir);
        }

        return @file_put_contents($fileDir . '/' . $this->fileName . '.html.twig', $this->twigTemplate);
    }