starphp Posted May 27, 2009 Share Posted May 27, 2009 Hello, For studying, I have started to work on a project which uses ZFramework.. I have set up the files and started the user registration.. Some of my doubts on this sections are: 1. Where will I write the common functions for the project ? (such as functions.php ) 2. I have created a Model for some common functions and tried to call it from Controller But it returns a fatal error. The code is: $functions = new Livefunctions(); $this->view->days = $functions->getDays(); The class "Livefunctions is available in the path: application/models/Livefunctions.php Code: class Livefunctions extends Zend_Db_Table_Abstract { public function getDays($month='', $year='') { } } Error is: Fatal error: Class 'Livefunctions' not found in D:\xampp\htdocs\live\application\controllers\IndexController.php on line 10 Quote Link to comment https://forums.phpfreaks.com/topic/159812-zend-framework-project/ Share on other sites More sharing options...
trq Posted May 27, 2009 Share Posted May 27, 2009 Where will I write the common functions for the project ? (such as functions.php ) This depends on what the functions actually do. You might want to write an action helper or a controller plugin, it really depend on the intended functionality. I have created a Model for some common functions and tried to call it from Controller But it returns a fatal error. The code is: application/models is not on your include path by default. You'll also want to look at the docs on Zend_Loader_Autoloader to set this up. Quote Link to comment https://forums.phpfreaks.com/topic/159812-zend-framework-project/#findComment-842936 Share on other sites More sharing options...
starphp Posted May 27, 2009 Author Share Posted May 27, 2009 Thank you.. Quote Link to comment https://forums.phpfreaks.com/topic/159812-zend-framework-project/#findComment-843014 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.