Get rid of the $uses line. It's incorrect usage.

On Wed, May 28, 2008 at 3:42 PM, gaeb <[EMAIL PROTECTED]> wrote:
>
> correction to my last post...it returns 1, not nothing.
>
> On May 28, 2:17 pm, gaeb <[EMAIL PROTECTED]> wrote:
>> This is my first time playing around with cake, and I am using 1.2
>> beta.
>>
>> I have three models (part, part_unit, part_unit_conversion) and one
>> controller (parts).  The models are very simple, but I have defined
>> relationships in them...part belongsTo part_unit, part hasMany
>> part_unit_conversion.  Here is my code for the controller;
>>
>> class PartsController extends AppController {
>>   var $name = 'Parts';
>>   // var $uses = array('Part', 'PartUnit');
>>
>>   function index() {
>>     $this->set('parts', $this->Part->findAll());
>>   }
>>
>>   function view($part_number = null) {
>>     $this->Part->part_number = $part_number;
>>     $this->set('part', $this->Part->read());
>>   }
>>
>> }
>>
>> I have a view for index, and view.  They both work just fine if $uses
>> is commented out, but when i put in the $uses line the view view gets
>> no data, but the index page is still fine.  Does anyone know why this
>> is?
>>
>> p.s. I am adding the uses line so I can get a list of acceptable
>> part_units so I can populate a select field on an add view.  Should I
>> not be doing it this way?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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