arnaud-lb / MtHaml

Multi target HAML (HAML for PHP, Twig, <your language here>)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nesting within interpolated string is illegal in site

dcnl1980 opened this issue · comments

I'm using Laravel 5.7 clean installation, and while trying to add this package with composer, add it to the app.php as Service Provider. The template is giving: "a nesting within interpolated string is illegal in site". Any ideas how to solve this? It seems php 7.1 related.

I got it running, the tabs where making the script not working. So I removed after tab in the lines. But I got another problem.

I have a file colours.haml, it's rendering correctly but it's render it to php which is not supporting it at all.

Code:

- @colors = ['blue', 'indigo', 'purple', 'pink', 'red', 'orange', 'yellow', 'green', 'teal', 'cyan', 'gray', 'gray-dark'];
- @variants = ['100', '200', '300', '400', '500', '600', '700', '800', '900'];

Output:

<?php @colors = ['blue', 'indigo', 'purple', 'pink', 'red', 'orange', 'yellow', 'green', 'teal', 'cyan', 'gray', 'gray-dark']; ?>
<?php @variants = ['100', '200', '300', '400', '500', '600', '700', '800', '900']; ?>
commented

For PHP, you should be using $ to prefix variables (@ is used for class variables in Ruby, and is not a Haml-specific thing).