Skip to content

Ruby string interpolation, double equals (==) #8

@derDoc

Description

@derDoc

In Haml a double equals interpolates a string the same way that a single equals interpolates ruby code, although the doc itself is quite quiet about that. So this

- @student = 'derDoc'
%p= "Hello #{@student}"
produces the same result as
%p== Hello #{@student}

produces:

<p>Hello derDoc</p>
produces the same result as
<p>Hello derDoc</p>

The same (with php vars) run through phphaml however, produces this:

<?php $student = 'derDoc';?><p<?php $this->writeAttributes(array (), array($student)); ?>><?php echo "Hello #"; ?>
</p>
produces the same result as
<p<?php $this->writeAttributes(array (), array($student)); ?>><?php echo Hello #; ?>
</p>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions