title: Including a PHP-file containing form in WordPress widget
body: <p>I'm currently developing a website where I need a widget to display the upcoming match. The site is for a football team. I've therefore created a plugin which creates a custom post type and a widget. Everything is working really well, but as I don't like to clutter my PHP code with HTML I figured I'd include the widget settings in from another file in the plugin directory. Although the include returns bool(true) nothing is showing in the widget form.</p>
  
  <p>Here is the code I'm using to include the file:</p>
  
  <pre><code>public function form($instance){
      require_once($this-&gt;plugin_directory.'/views/widget-form.php');
  }
  </code></pre>
  
  <p>The variable $this->plugin directory is defined in the constructor and points to the correct path.</p>
  
  <p>Here is the html code inside the included file, it's brief but just to test. No matter what I type in there it keeps returning blank.</p>
  
  <pre><code>&lt;input type="text" name="title" value="Hello World!" /&gt;
  </code></pre>
  
  <p>Any ideas why this keeps happening, or doesn't WordPress support loading extra files in places like this? I could just have my html in the plugin-file, but I prefer to keep PHP clean, and not cluttered with HTML and/or CSS, JS etc.</p>
  
  <p><em>If anyone could help me figure this out I would greatly appreciate it! :)</em></p>
  
  <p>Thanks in advance,
  Jonathan</p>