title: Call to undefined method JController::getInstance()
body: <p>i seem to have tried everything. I am trying to learn how to create a new component and currently my folder structure looks like this (please note that the component does install).</p>
  
  <p>This is a picture of my folder structure:</p>
  
  <p><img src="https://i.stack.imgur.com/2wJPu.png" alt="enter image description here"></p>
  
  <p>Ive closed some of it because i found it irelevant but please if you need to see whats inside of them please let me know.</p>
  
  <p>as i stated above the component does install without problems. however when i try to access it i get the following error:</p>
  
  <pre><code>Fatal error: Call to undefined method JController::getInstance() in /home/marcrasm/public_html/Joomla/administrator/components/com_helloworld/helloworld.php on line 13
  </code></pre>
  
  <p>Now the file it is refering to is this one:</p>
  
  <pre><code>    &lt;?php
  defined('_JEXEC') or die ('Restricted access');
  
  jimport('joomla.application.component.controller');
  
  $doc = JFactory::getDocument();
  $doc-&gt;addScript("/components/com_helloworld/js/jquery.js");
  $doc-&gt;addScript("/components/com_helloworld/js/com_helloworld_script.js");
  $doc-&gt;addStyleSheet("/components/com_helloworld/css/com_helloworld_layout.css");
  
  // gets the instance of the controller
  // Get an instance of the controller prefixed by HelloWorld
  $controller = JController::getInstance('HelloWorld');
  
  // Perform the Request task
  $input = JFactory::getApplication()-&gt;input;
  $controller-&gt;execute($input-&gt;getCmd('task'));
  
  // Redirect if set by the controller
  $controller-&gt;redirect();
  </code></pre>
  
  <p>I know it can be hard to tell but does anyone know what the problem might be?</p>