# |
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 |
# |
Aug 10th 2008, 09:23 |
kalileo |
the result is an array |
# |
Aug 10th 2008, 09:23 |
kalileo |
pyite: maybe a foreach loop - but I don't really know what you're after |
# |
Aug 10th 2008, 09:20 |
pyite |
though i do see how to call ->find() on an imported model... |
# |
Aug 10th 2008, 09:19 |
pyite |
can anyone tell me how to cycle through the results of a ->find() call to a model, from within a controller? sorry for such a basic question but i'm not seeing the answer in the docs |
# |
Aug 10th 2008, 08:47 |
primeminister |
thanks again! |
# |
Aug 10th 2008, 08:47 |
primeminister |
achew22: yeah. i'm on it |
# |
Aug 10th 2008, 08:46 |
achew22 |
but it may be wrong |
# |
Aug 10th 2008, 08:46 |
achew22 |
I don't see anything wrong |
# |
Aug 10th 2008, 08:46 |
achew22 |
I would check your regexp |
# |
Aug 10th 2008, 08:46 |
achew22 |
strange |
# |
Aug 10th 2008, 08:45 |
primeminister |
wauw |