Is the Country model's file name "country.php"?

On Mon, Sep 7, 2009 at 1:32 AM, sup<[email protected]> wrote:
>
> Hello there,
>
> I am very new in cake, have tried to join tables through cake.
> I have many cities under countries table.I have country_id column in
> cities table.
> I write in  the country model:
> class Country extends AppModel {
>        var $name = 'Country';
>        var $hasMany = array('City');
>        var $order = "Country.name ASC";
> }
> In the city model:
> class City extends AppModel {
>  var $name = 'City';
>  //The Associations below have been created with all possible keys,
> those that are not needed can be removed
>  var $belongsTo = array('Country');
>  var $order = "City.name ASC";
>
>  var $validate = array(
>    'name' =>VALID_NOT_EMPTY,
>  );
>
> }
>
> But when trying to use the following line
>
>  $cities=$this->City->Country->find('list');
>
> in cities_controller.php i get the error
>
> Fatal error: Class 'Country' not found in c:\program files\wamp\www
> \YSDK\cake\libs\model\model_php5.php on line 438.
>
> Please help.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to