arnaud-lb / MtHaml

Multi target HAML (HAML for PHP, Twig, <your language here>)
Other
359 stars 54 forks source link

Using class constant fails #107

Open Bonscho opened 5 years ago

Bonscho commented 5 years ago

HAML like the following fails:

%a(href="#{Namespace\ClassName\::CLASS_CONSTANT}") Label

The resulting exception is MtHaml\Exception\SyntaxErrorException in vendor/mthaml/mthaml/lib/MtHaml/Parser.php on line 844 with message: Unexpected '"', expected target language expression in /var/www/content-vendor/app/templates/generic/components/topbar.haml on line x, column xx

srpatel commented 4 years ago

Backslashes separate namespaces, you don't put one before the ::. Try:

%a(href="#{Namespace\ClassName::CLASS_CONSTANT}") Label