Closed ghost closed 12 years ago
The error message Inconsistent indentation: 6 is not a multiple of 4
means that you used different indentation width on different lines. From the error message it seems that you formatted your code like this:
%a{:href => "/demo/secured/hello/admin/World"}
Hello resource secured for
If the second line was indented with 8 spaces it would work.
Yeah, I did that - but still i get this error message. Correct me if I am wrong. My indentation seems to be right. this is how my code looks like:
%a{:href => "/demo/secured/hello/admin/World"}
Hello resource secured for
%strong admin
only.
still getting exeption :-/
The message means that the first indented line in the file is indented with 4 spaces, which implies that every other line must be indented with multiples of 4 spaces
Yes, you are right.
- block content
%h1 Hello #{ name }!
%a{:href => "/demo/secured/hello/admin/World"}
Hello resource secured for
%strong admin
only.
- block content
%h1 Hello #{ name }!
%a{:href => "/demo/secured/hello/admin/World"}
Hello resource secured for
%strong admin
only.
That was the problem. Thank you so much for support! Great!
In order to get this result in HTML:
<a href="/demo/secured/hello/admin/World">Hello resource secured for <strong>admin</strong> only.</a>
usually haml should look like this:
%a{:href => "/demo/secured/hello/admin/World"} Hello resource secured for %strong admin only.
instead of result Symfony throws an exeption:
CRITICAL - Twig_Error_Runtime: An exception has been thrown during the compilation of a template ("Inconsistent indentation: 6 is not a multiple of 4 in AcmeDemoBundle:Secured:hello.html.haml on line 8, column 7") in "/projects/symfony-test/src/Acme/DemoBundle/Resources/views/Secured/hello.html.haml". (uncaught exception) at /projects/symfony-test/app/cache/dev/classes.php line 6880
question:
why is it not possible to put nested haml tags inside of an anchor-tag?