{"id":6241,"date":"2014-04-14T03:22:10","date_gmt":"2014-04-14T03:22:10","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/14\/zend-framework-model-class-not-found-in-module-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:47:09","modified_gmt":"2022-08-30T15:47:09","slug":"zend-framework-model-class-not-found-in-module-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/14\/zend-framework-model-class-not-found-in-module-collection-of-common-programming-errors\/","title":{"rendered":"Zend Framework , Model Class not found in Module-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;ve Created an application with these details :<\/p>\n<p>1- zf create project MyApp<\/p>\n<p>2- zf create module admin<\/p>\n<p>3- zf create controller Index 1 admin<\/p>\n<p>MyApp\/application\/modules\/admin\/controllers\/IndexController.php :<\/p>\n<pre><code>class admin_IndexController extends Zend_Controller_Action\n{\n\n    public function init()\n    {\n        error_reporting(E_ALL);\n        ini_set('display_errors', 'On');\n    }\n\n    public function indexAction()\n    {\n\n        $aa = new Admin_Model_DbTable_Posts();\n\n    }\n\n}\n<\/code><\/pre>\n<p>application.ini :<\/p>\n<pre><code>[production]\nphpSettings.display_startup_errors = 0\nphpSettings.display_errors = 0 \nincludePaths.library = APPLICATION_PATH \"\/..\/library\" \nbootstrap.path = APPLICATION_PATH \"\/Bootstrap.php\"\nbootstrap.class = \"Bootstrap\" \nappnamespace = \"Application\"\nresources.frontController.controllerDirectory = APPLICATION_PATH \"\/controllers\"\nresources.frontController.params.displayExceptions = 0\nresources.frontController.moduleDirectory = APPLICATION_PATH \"\/modules\"\n<\/code><\/pre>\n<p>MyApp\/application\/modules\/admin\/models\/DbTable\/Posts.php :<\/p>\n<pre><code>class Admin_Model_DbTable_Posts extends Zend_Db_Table_Abstract    \n{\n    public function init()\n    {\n\n    }\n}\n<\/code><\/pre>\n<p>In this point I get the error :<\/p>\n<pre><code>Fatal error: Class 'Admin_Model_DbTable_Posts' not found in \/var\/www\/MyApp\/application\/modules\/admin\/controllers\/IndexController.php on line 16\n<\/code><\/pre>\n<p>and When i put this line on application.ini<\/p>\n<pre><code>resources.modules[] =\n<\/code><\/pre>\n<p>And add bootstratp.php in admin folder with these content<\/p>\n<pre><code>class Admin_Bootstrap extends Zend_Application_Bootstrap_Bootstrap\n{\n\n}\n<\/code><\/pre>\n<p>After a long period of requesting , i get this error :<\/p>\n<pre><code>HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.\n<\/code><\/pre>\n<p>what should i do to make it work?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve Created an application with these details : 1- zf create project MyApp 2- zf create module admin 3- zf create controller Index 1 admin MyApp\/application\/modules\/admin\/controllers\/IndexController.php : class admin_IndexController extends Zend_Controller_Action { public function init() { error_reporting(E_ALL); ini_set(&#8216;display_errors&#8217;, &#8216;On&#8217;); } public function indexAction() { $aa = new Admin_Model_DbTable_Posts(); } } application.ini : [production] phpSettings.display_startup_errors = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,8],"tags":[],"class_list":["post-6241","post","type-post","status-publish","format-standard","hentry","category-uncategorized","category-zend-framework"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6241"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6241\/revisions"}],"predecessor-version":[{"id":8879,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6241\/revisions\/8879"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}