G'day
Ah, finally found the right reference. Don't know how I missed it on
the first time through the CakePHP manual but I plan on re-reading it
anyway . The var $uses = is the solution. Thanks anyway, and
sorry for the extra noise...;-)
http://manual.cakephp.org/chapter/controllers
On Nov 14, 5:18 pm, ldb [EMAIL PROTECTED] wrote:
G'day
I feel that I am somewhat standing in front of a forest shooting at
it, hoping to hit a tree looking for what would cause the following. I
am hoping I've just missed something in my usage of CakePHP here and
someone can refer me to the right doc.
I have a controller called model_alternates_controller.php which
contains the following lines (amoung others):
$this-ModelAlternate-recursive = 0;
$this-set('modelAlternates',
$this-ModelAlternate-findAll());
$this-set('tirelist', $this-ModelAlternate-
generateList( ));
I have two views defined in the following structure:
app/views/model_alternates/index.thtml
app/views/models/index.thtml
In app/views/model_alternates/index.thtml, I have the following:
div
?php
echo $html-selectTag('ModelAlternate/
alt_model_id', $tirelist, null, array('Model_Number' =
'model_alternates'));
?
/div
This works fine in the models_alternates view but putting the same
lines in the models/index.thtml just gives me Notice: Undefined
variable: tirelist in /cakehome/app/views/models/index.thtml on line
16. It uses the same controller, maybe I am fighting the naming
conventions between models/controllers and views?
I was originally trying to set up display that when a model code was
selected, the other box of alternate choices would change according
to the contents of that table. But the model_alternates table has an
autoincrement key as the primary. I was trying what I had read about
for setting that scenario up and it was not working so I set this up
as a smaller test to make sure I hadn't misunderstood the basics of
the selects in CakePHP. I figure I missed reading something but have
been reading alot today, mostly wrong turns but very educational ones.
Can anyone please tell me which grove of trees to aim for?
Thanks...
--
ldb
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---