title: Zend Framework: Calling function from a different file
body: <p>*<strong>*Edit2: Core.php was not found because Bootstrap.php needed Core.php included
      require_once 'C:\wamp\www\PhpProject1\application\Core\Core.php';
  Solved my Problem **</strong></p>
  
  <hr>
  
  <p>I am using zendframework and i created a new folder with file Core/Core.php for my functions that i will use in my controllers and elsewhere. But when i try to test a function in my Core.php nothing will show up. I think i am calling the core.php incorrectly but im not sure what the error is.</p>
  
  <p>application/controllers/</p>
  
  <p>IndexController.php</p>
  
  <pre><code>class IndexController extends Zend_Controller_Action
  {
  
       public function init()
      {
           $this-&gt;tournamentAction();
      }
  
     public function indexAction(){          
  
     }
  
      public function tournamentAction()
    {            
          $bleh = new Core();
          $this-&gt;view-&gt;ha = $bleh-&gt;yo();
          $this-&gt;renderScript('tournament/index.phtml');            
      }    
  }
  </code></pre>
  
  <p>application/Core/</p>
  
  <p>Core.php</p>
  
  <pre><code>class Core{
  
      public function init(){
  
      }
  
      public function indexAction(){
  
      }
      public function yo(){
          $text = 'This is my function Yo';
          return $text;
      }
  </code></pre>
  
  <p>application/views/scripts/tournament/
  index.phtml</p>
  
  <pre><code>$this-&gt;ha;
  echo "hello";
  </code></pre>
  
  <p><strong>Edit: Error reporting is nice ha! This is the error i get.</strong></p>
  
  <pre><code> ! ) Fatal error: Class 'Core' not found in C:\wamp\www\PhpProject1\application\controllers\IndexController.php on line 19
  Call Stack
  #   Time    Memory  Function    Location
  1   0.0006  678944  {main}( )   ..\index.php:0
  2   0.0275  3090632 Zend_Application-&gt;run( )    ..\index.php:26
  3   0.0275  3090632 Zend_Application_Bootstrap_Bootstrap-&gt;run( )    ..\Application.php:366
  4   0.0275  3090728 Zend_Controller_Front-&gt;dispatch( )  ..\Bootstrap.php:97
  5   0.0446  4801056 Zend_Controller_Dispatcher_Standard-&gt;dispatch( )    ..\Front.php:954
  6   0.0456  4823424 Zend_Controller_Action-&gt;__construct( )  ..\Standard.php:268
  7   0.0547  5211576 IndexController-&gt;init( )    ..\Action.php:133
  8   0.0547  5211576 IndexController-&gt;tournamentAction( )    ..\IndexController.php:8
  </code></pre>