title: Include HTML inside partial and inside function
body: <p>I am creating some widget for Word Press, but maybe this is standard PHP question, because it is related to some MVC pattern. I have some HTML that i need to output on page but that HTML is for now i inside function, i would like to transfer it to partial, because in the future there can be lots of more HTML, and if I make it like this it will be lots of spaghetti code.Here is what i have for now</p>
  
  <pre><code>class motractrucks extends WP_Widget{
    function widget($args, $instance, $defaults){
    echo '&lt;p&gt;'.$value1.'&lt;p&gt;'; 
    echo '&lt;p&gt;'.$value2.'&lt;p&gt;'; 
    echo '&lt;p&gt;'.$value3.'&lt;p&gt;'; 
    echo '&lt;p&gt;'.$value4.'&lt;p&gt;'; 
    echo '&lt;p&gt;'.$value5.'&lt;p&gt;'; 
    echo '&lt;p&gt;'.$value6.'&lt;p&gt;';
   }
  }
  </code></pre>
  
  <p>This is just simple example, I have modified function easy that you can understand what i need, i was thinking to do something like, but how to pass values form inside function in that view?</p>
  
  <pre><code>class motractrucks extends WP_Widget{
    function widget($args, $instance, $defaults){
     include 'partials/userValues.php';
   }
  }
  </code></pre>
  
  <p>And pass all values to that partial, any good idea and best code practice will be nice.</p>