Jump to content

Recommended Posts

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

 

 

Link to comment
https://forums.phpfreaks.com/topic/159812-zend-framework-project/
Share on other sites

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.

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.