Your controller needs to be plural.

addresses_controller.php

class AddressesController extends AppController
{
    var $name = "Addresses";
}

On 8/15/06, jbernat <[EMAIL PROTECTED]> wrote:

I am baking my first Cake app, and I created a controller named
"address_controller.php" for a table named "addresses":

<?php

class AddressController extends AppController
{
    var $name = 'Address';
    //var $scaffold;

}

?>

I created a model called "address.php":

<?php
class Address extends AppModel
{
    var $name = 'Address';
    var $belongsTo = array('User' =>
                           array('className'  => 'User',
                                 'conditions' => '',
                                 'order'      => '',
                                 'foreignKey' => 'user_id'
                           )
                     );
}
?>

I attempt to access the URL .../address/add and get the following Model
Not Found error:

Fatal: Unable to load model Addres
Fatal: Create Class:

<?php
class Addres extends AppModel
{
    var $name = 'Addres';
}
?>

in file : app\models\addres.php


Why is it looking for addres.php with a class named 'Addres' instead of
address.php and 'Address'?

Thanks in advance for your help!
Jim
http://www.photips.com




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to