MtHaml icon indicating copy to clipboard operation
MtHaml copied to clipboard

nesting within interpolated string is illegal in site

Open dcnl1980 opened this issue 6 years ago • 2 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.

dcnl1980 avatar Jan 27 '19 13:01 dcnl1980

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']; ?>

dcnl1980 avatar Jan 27 '19 20:01 dcnl1980

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

srpatel avatar Jan 02 '20 08:01 srpatel