Zend Framework Forum

Go Back   Zend Framework Forum > Zend Framework General discussions > Installation & Configuration

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-14-2009, 12:06 AM
Junior Member
 
Join Date: May 2009
Posts: 2
Default Canīt load models

Hi there,

I'm trying to follow the tutorial in Akra’s DevNotes Tutorial: Getting Started with Zend Framework 1.8 but with little sucess!

When I get to part that I need to add the code:

public function indexAction()
{
$this->view->title = "My Albums";
$this->view->headTitle($this->view->title, 'PREPEND');
$albums = new Model_DbTable_Albums();
$this->view->albums = $albums->fetchAll();
}

In the IndexController I always get this error:



I think the warnings are related to the //in the path
/home/cardcc/public_html/zendframework/zend3/application/models/DbTable//Albums.php

after the warnings obviously comes the Fatal error due to the fact that i couldn't load the model.

So how do i solve this? Please help this newbie!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-14-2009, 09:40 AM
Senior Member
 
Join Date: Apr 2009
Posts: 136
Default

Yout model file should be named exactly as its class name, i.e.: class Albums => Albums.php. You should also set models directory in your include path...
__________________
My site | My profile | Webfolio CMS
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-14-2009, 06:22 PM
Junior Member
 
Join Date: May 2009
Posts: 2
Default

Quote:
Originally Posted by alokin View Post
Yout model file should be named exactly as its class name, i.e.: class Albums => Albums.php. You should also set models directory in your include path...
Could you be more specific?

I'm just following the tutorial, why should I change any name??
The only thing i had to change would be the database details...

How can I set the models directory and in which file? I could show my files but they are exactly like the ones in the tutorial...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-14-2009, 11:43 PM
Senior Member
 
Join Date: Jul 2008
Posts: 288
Default

There shouldn't be any need to rename the class/file as suggested - the resource autoloader should find it, your configuration looks good as far as I can see (I haven't read that tutorial).

Does the file /home/cardcc/public_html/zendframework/zend3/application/models/DbTable/Albums.php exist?

I just checked a working app I have and it also causes the double slash // in the resource autoloader but it doesn't prevent anything from loading (on a linux box). So it does seem like a bug, but doesn't seem to matter. (You could check this on your platform by adding a // to any include/require you know works otherwise).
__________________
Brenton Alker
PHP Developer - Brisbane, Australia

blog.tekerson.com | twitter.com/tekerson | brenton.mp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-15-2009, 01:36 AM
Junior Member
 
Join Date: May 2009
Posts: 11
Lightbulb Following same tutorial

Hi,
I am following the same tutorial as you. and i am facing problem in setting up actions in IndexController.php.
Please read my post at
CLI php.exe not found
and give me any solution.
Regards,
Umair
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-16-2009, 11:11 AM
Junior Member
 
Join Date: Mar 2009
Location: china beijing
Posts: 3
Send a message via MSN to myos
Smile

hi I have the same problem, I can't find it answer, Do you ravel out it? please tell me , thank you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT. The time now is 01:07 AM.


Designed by: Miner Skinz Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0