title: Adding variables inside constants
body: <p>I'm using constants for my error messages inside the Views, and I want to be able to use variables inside them for easier management.</p>
  
  <p>Most of my constants looks like this:</p>
  
  <pre><code>const SUCCESSFULLY_REGISTERED = "&lt;p class='success'&gt;Registration successful!.&lt;/p&gt;";
  </code></pre>
  
  <p>What I want to do is to use a variable for the css class, so that it's easier to change them all in one place. This is what I've tried:</p>
  
  <pre><code>const SUCCESSFULLY_REGISTERED = "&lt;p class='$this-&gt;cssClassSuccess'&gt;Registration successful!.&lt;/p&gt;&lt;p&gt;Log in with the username and password you registered with.&lt;/p&gt;";
  </code></pre>
  
  <p>By some reason that doesn't work and raises the error message below. Why is that and how can this be done in a way that works?</p>
  
  <pre><code>Parse error: syntax error, unexpected '"' in .../View/RegisterView.php on line 15
  </code></pre>