Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using class constant fails #107

Open
Bonscho opened this issue Jan 23, 2019 · 1 comment
Open

Using class constant fails #107

Bonscho opened this issue Jan 23, 2019 · 1 comment

Comments

@Bonscho
Copy link

Bonscho commented Jan 23, 2019

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
Copy link

srpatel commented Jan 2, 2020

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants