# |
Aug 10th 2008, 09:35 |
kalileo |
how can it be used by the foreach in your code? |
# |
Aug 10th 2008, 09:35 |
pyite |
it's usually done for me by the time i get to a view |
# |
Aug 10th 2008, 09:34 |
pyite |
so i have a misunderstanding in how this works |
# |
Aug 10th 2008, 09:34 |
pyite |
ahh |
# |
Aug 10th 2008, 09:34 |
kalileo |
then you try to loop through the model object |
# |
Aug 10th 2008, 09:34 |
pyite |
it's used in the foreach(), no? |
# |
Aug 10th 2008, 09:34 |
kalileo |
your data result goes to nowhereland |
# |
Aug 10th 2008, 09:34 |
pyite |
that doesn't capture the returned data? |
# |
Aug 10th 2008, 09:34 |
kalileo |
$data = $extensions->find('all',... |
# |
Aug 10th 2008, 09:34 |
pyite |
not sure what u mean... |
# |
Aug 10th 2008, 09:33 |
kalileo |
return |
# |
Aug 10th 2008, 09:33 |
kalileo |
well, you do not capture the data find might f\return |
# |
Aug 10th 2008, 09:33 |
pyite |
when i var_dump the code i do have, there's no actual data retrieved in the resulting var |
# |
Aug 10th 2008, 09:33 |
pyite |
maybe that's what i'm missing |
# |
Aug 10th 2008, 09:32 |
pyite |
what does "fetchData" do? i see that elsewhere in another person's example, with this same scenario |
# |
Aug 10th 2008, 09:31 |
pyite |
or should i be using ->data somewhere? |
# |
Aug 10th 2008, 09:30 |
pyite |
maybe there is a lame syntatical error somewhere? |
# |
Aug 10th 2008, 09:30 |
pyite |
for this method |
# |
Aug 10th 2008, 09:30 |
pyite |
that's why i manually imported the model |
# |
Aug 10th 2008, 09:30 |
pyite |
yes, that's what i mean |
# |
Aug 10th 2008, 09:30 |
pyite |
that code results in "Fatal error: Cannot use string offset as an array in /var/www/html/cake/app/controllers/config_controller.php on line" |
# |
Aug 10th 2008, 09:30 |
kalileo |
You mean their Models have no association? |
# |
Aug 10th 2008, 09:29 |
pyite |
ConfigController is not related to ExtensionController |
# |
Aug 10th 2008, 09:29 |
pyite |
http://bin.cakephp.org/view/2007385952 |
# |
Aug 10th 2008, 09:26 |
pyite |
i agree it should work |
# |
Aug 10th 2008, 09:26 |
pyite |
it's simple code |
# |
Aug 10th 2008, 09:26 |
pyite |
can i pastebin? |
# |
Aug 10th 2008, 09:26 |
kalileo |
aeeay = array |
# |
Aug 10th 2008, 09:26 |
pyite |
kalileo:i got an array but it seems like it's full of garbage basically.. |
# |
Aug 10th 2008, 09:26 |
pyite |
in order to do that, it needs to read data from ALL other models |
# |
Aug 10th 2008, 09:25 |
pyite |
err sorry |
# |
Aug 10th 2008, 09:25 |
kalileo |
pyite: if you do not get an aeeay as result of your find than you did something wrong |
# |
Aug 10th 2008, 09:25 |
pyite |
in order to do that, it needs to read data from ALL other controllers |
# |
Aug 10th 2008, 09:25 |
pyite |
kalileo: in fact, the model of the controller is nothing basically - the controller i'm working on right now is a function to "Write configuration to disk" |
# |
Aug 10th 2008, 09:25 |
pyite |
kalileo: no it does not |
# |
Aug 10th 2008, 09:25 |
pyite |
if i dump the contents of the returned variable there is a behaviorcontroller in there that prevents me from understanding what's in there... |
# |
Aug 10th 2008, 09:25 |
kalileo |
pyite: does your target Model have any association withteh Model of the controller? |
# |
Aug 10th 2008, 09:24 |
pyite |
kalileo: but i can't find anything to cycle through the data that is returned by find() from within the controller. doing a foreach works from a VIEW but doesn't seem to work in the controller... |
# |
Aug 10th 2008, 09:24 |
pyite |
kalileo: i've done app::import to include the OTHER model in this particular method, and that worked. then i call find() on the model, that seems to work |
# |
Aug 10th 2008, 09:23 |
pyite |
kalileo: thanks for trying to help... right now, i am trying to retrieve data from within a controller from a model that's not associated with that controller |
# |
Aug 10th 2008, 09:23 |
kalileo |
so you can loop through it |