public function validateTwig($attribute)
    {
        $twig = $this->getTwig(new \Twig_Loader_String());

        try {
            $twig->render($this->$attribute);
        } catch (\Exception $e) {
            $message = "Error compiling {$attribute}: " . $e->getMessage();
            $this->addError($attribute, $message);
        }
    }