title: Is it bad to use html inside a php class?
body: <p>is there anything wrong with using html inside a class function? I call it in the DOM so I don't need a string returned.</p>
  
  <pre><code>public function the_contact_table(){
      ?&gt;
      &lt;div&gt;
          some html here
      &lt;/div&gt;
      &lt;?php
  }
  </code></pre>
  
  <p>Also when I do need the string I use this method? Is there a better way or is this relatively standard?</p>
  
  <pre><code>public function get_single(){
      ob_start();?&gt;
          &lt;div class='staff-member single'&gt;
              &lt;div class='col left'&gt;
                  &lt;div class='thumbnail'&gt;
                      thumbnail
                  &lt;/div&gt;
                  &lt;?php $this-&gt;the_contact_table(); ?&gt;
              &lt;/div&gt;
              &lt;div class='col right'&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;      
      &lt;?php
      $content = ob_get_contents();
      ob_end_clean();
      return $content;
  }
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I should have explained why i am doing this. I'm making a Wordpress plugin  and want to control a post types output. So I am using a filter like below</p>
  
  <pre><code>public function filter_single($content){
       global $post;
       if ($post-&gt;post_type == 'staff-member') {
  
           $sm = new JM_Staff_Member($post);
           $content = $sm-&gt;get_single();
       }
       return $content;
  }
  </code></pre>
  
  <p>So as you can see, I <em>must</em> return a string to the wordpress core</p>