Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I believe it's PHP eating the newline after the ?>. Generally this is a good thing, but I can see why it is annoying in your case.</p> <p>You'll probably need to do something like this:</p> <pre><code>Title: &lt;?= $this-&gt;escape($this-&gt;vacancyDetail-&gt;references['vacancy_type'])."\n" ?&gt; Location: &lt;?= $this-&gt;vacancyDetail-&gt;references['name']."\n" ?&gt; Department: &lt;?= $this-&gt;vacancyDetail-&gt;references['department_name']."\n" ?&gt; </code></pre> <p>Edit: </p> <p>Here's a reference just to confirm I'm not going crazy: <a href="http://www.php.net/manual/en/faq.using.php#faq.using.newlines" rel="nofollow noreferrer">http://www.php.net/manual/en/faq.using.php#faq.using.newlines</a></p> <p>Why is this a good thing? Well imagine your email template was:</p> <pre><code>Title: &lt;?= $this-&gt;escape($this-&gt;vacancyDetail-&gt;references['vacancy_type'])."\n" ?&gt; &lt;?php if (!empty($this-&gt;vacancyDetail-&gt;references['name'])) { ?&gt; Location: &lt;?= $this-&gt;vacancyDetail-&gt;references['name']."\n" ?&gt; &lt;?php } ?&gt; Departments: &lt;?php foreach ($this-&gt;vacancyDetail-&gt;references['departments'] as $dept) { ?&gt; &lt;?=$dept-&gt;name."\n"?&gt; &lt;?php } ?&gt; </code></pre> <p>in that situation you wouldn't want to end up with several newlines between each of the lines that's actually output (a problem I had recently in an email template for a non-PHP project). </p> <p>Another option for you might be to not store your templates in PHP, just use {name}, {department_name} or similar for your variables and then parse them out. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload