title: What is a good programming pattern to prevent html mixed in PHP?
body: <p>I am currently developing a website that containts multiple types of users.</p>
  
  <p>Examples of the types:
  type a, type b, type c</p>
  
  <p>all types can do different things with different rights.
  What I am currently doing; for example in the navigation is:</p>
  
  <pre><code>&lt;?php
  if($user_type == "a"){
  ?&gt;
  &lt;ul&gt;
      &lt;li&gt;&lt;a href="javascript:void(0);"&gt;You can see this&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="javascript:void(0);"&gt;And this&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="javascript:void(0);"&gt;also this&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;?php
  }elseif($user_type == "b"){
  ?&gt;
  &lt;ul&gt;
      &lt;li&gt;&lt;a href="javascript:void(0);"&gt;You can see this&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="javascript:void(0);"&gt;also this&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;?php
  }elseif($user_type == "c"){
  ?&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href="javascript:void(0);"&gt;You can see this&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;?php
  }
  ?&gt;
  </code></pre>
  
  <p>And that for every element where they have different rights.</p>
  
  <p>This can look better or not?</p>
  
  <p>Does someone have an example of an design/programming pattern that I can use to prevent if else and html mixed with php?</p>
  
  <p>Thanks :)</p>