protected function renderFile($template, $target, $model)
    {
        if (!is_dir(dirname($target))) {
            mkdir(dirname($target), 0777, true);
        }

        $this->files[] = $target;

        return file_put_contents($target, $this->render($template, $model));
    }