Author Topic: Zend Framework project  (Read 763 times)

0 Members and 1 Guest are viewing this topic.

Offline starphpTopic starter

  • Enthusiast
  • Posts: 59
  • Gender: Male
    • View Profile
Zend Framework project
« on: May 27, 2009, 01:52:28 AM »
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:

Code: [Select]

$functions = new Livefunctions();
$this->view->days = $functions->getDays();


The class "Livefunctions is available in the path:

application/models/Livefunctions.php


Code:
Code: [Select]

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


Offline thorpe

  • Administrator
  • 'Mind Boggling!'
  • *
  • Posts: 29,255
    • View Profile
Re: Zend Framework project
« Reply #1 on: May 27, 2009, 04:01:12 AM »
Quote
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.

Quote
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.


Offline starphpTopic starter

  • Enthusiast
  • Posts: 59
  • Gender: Male
    • View Profile
Re: Zend Framework project
« Reply #2 on: May 27, 2009, 07:52:56 AM »
Thank you..