Hello Alex
I'm building a website with a core system like yours, login, forum, news, etc.
I'm using Zend framework, I use Zend_Auth, Zend_Layout, Zend_Registry, Zend_DB.
I finish the layout and The login part is done.
Now I'm starting to develop my own controllers and classes, and I have this doubt, how to use my own classes globally in the website or where to declare my own classes, that I can use in any part of the website.
Look what I did and work just fine, But I believe this approach in wrong. The classes can't be located in the models directory.
I create this file user.php and I locate this file in the models directory.
class User extends Zend_Db_Table
{
public function getUserName($id)
{
// take the ID and get the username in the DB
}
}
and I did this in the bootstrap.
Zend_Loader::loadClass('User');
Now I can call the class in any part of my website, this way:
$user = New User();
echo $user->getUserName($id);
Can you tell how I can do this the right way. Where I need to declare my classes or where I need to locate the files and then use it that way.
Thank you for you time