Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to add your own library to Zend Framework
    text
    copied!<p>So i have been designig an application to run on the Zend Framework 1.11 And as any programmer would do when he sees repeated functionalities i wanted to go build a base class with said functionalities.</p> <p>Now my plan is to build a library 'My' so i made a folder in the library directory in the application. So it looks like this</p> <pre><code>Project Application docs library My public test </code></pre> <p>So i created a BaseController class in the My folder and then decided to have the IndexController in my application extend the BaseController. </p> <p>The Basecontroller looks like this :</p> <pre><code>class My_BaseController extends Zend_Controller_Action { public function indexAction() { $this-&gt;view-&gt;test = 'Hallo Wereld!'; } } </code></pre> <p>And the IndexController looks like this :</p> <pre><code>class WMSController extends My_BaseController { public function indexAction() { parent::indexAction(); } } </code></pre> <p>As adviced by a number of resources i tried adding the namespace for the library in the application.ini using the line</p> <pre><code>autoloadernamespaces.my = “My_” </code></pre> <p>But when i try to run this application i recieve the following error</p> <blockquote> <p>Fatal error: Class 'My_BaseController' not found in C:\wamp\www\ZendTest\application\controllers\IndexController.php</p> </blockquote> <p>Am i missing something here? Or am i just being a muppet and should try a different approach?</p> <p>Thanks in advance!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload