# |
Aug 8th 2008, 23:18 |
Veracious |
I'm trying to make multiple models in one form to work so I can add a row to multiple tables in one go. Any idea how to go about it? I searched about an hour on google but didn't find anything that would work |
# |
Aug 8th 2008, 23:05 |
freebox |
ok, i'll test |
# |
Aug 8th 2008, 23:03 |
markstory |
in view: echo $this->element('categories', compact('categories')); |
# |
Aug 8th 2008, 23:03 |
markstory |
make a categories element. |
# |
Aug 8th 2008, 23:02 |
markstory |
so in controller: $this->set('categories', $this->category->find('all')); |
# |
Aug 8th 2008, 23:02 |
freebox |
uhm |
# |
Aug 8th 2008, 23:02 |
markstory |
I put functions into models, and then make elements that can render those functions |
# |
Aug 8th 2008, 23:01 |
freebox |
markstory: what i can use to it? |
# |
Aug 8th 2008, 23:01 |
freebox |
and nothing appears |
# |
Aug 8th 2008, 23:01 |
markstory |
I honestly almost never use requestAction. |
# |
Aug 8th 2008, 23:01 |
freebox |
i'm doing die($categoria); to test |
# |
Aug 8th 2008, 23:01 |
freebox |
no |
# |
Aug 8th 2008, 23:00 |
markstory |
requestAction returns text I bet. |
# |
Aug 8th 2008, 22:59 |
freebox |
this work fine |
# |
Aug 8th 2008, 22:59 |
freebox |
dammit, if i go to localhost/app/categorias/index/sort:nome/order:asc |
# |
Aug 8th 2008, 22:59 |
freebox |
Warning (2): Invalid argument supplied for foreach() [APP\views\elements\menu_categorias.ctp, line 3] |
# |
Aug 8th 2008, 22:59 |
freebox |
uhm |
# |
Aug 8th 2008, 22:58 |
markstory |
the first slash is important. |
# |
Aug 8th 2008, 22:58 |
markstory |
requestAction('/categorias/index'); |
# |
Aug 8th 2008, 22:58 |
freebox |
$categorias = NULL |
# |
Aug 8th 2008, 22:58 |
markstory |
just make sure you cache the element. |
# |
Aug 8th 2008, 22:58 |
freebox |
isn't working |
# |
Aug 8th 2008, 22:57 |
markstory |
freebox: that will work too. |
# |
Aug 8th 2008, 22:57 |
freebox |
? |
# |
Aug 8th 2008, 22:57 |
freebox |
$categorias = $this->requestAction('categorias/index/sort:nome/order:asc'); |
# |
Aug 8th 2008, 22:57 |
freebox |
markstory: is this way to get my records in the element |
# |
Aug 8th 2008, 22:51 |
markstory |
anytime. |
# |
Aug 8th 2008, 22:51 |
M4ngoB00M |
;) |
# |
Aug 8th 2008, 22:51 |
M4ngoB00M |
ok - thanks - i will look at them |
# |
Aug 8th 2008, 22:50 |
markstory |
and bake should find them and use them. |
# |
Aug 8th 2008, 22:50 |
markstory |
you can place them in vendors/templates/views when you've edited them. |
# |
Aug 8th 2008, 22:50 |
markstory |
M4ngoB00M: I would suggest just looking at the stock templates and editing those. |
# |
Aug 8th 2008, 22:49 |
markstory |
the templates are a bit tricky to make but you can find the core ones in cake/console/libs/templates/views/ |
# |
Aug 8th 2008, 22:49 |
M4ngoB00M |
hmm - ok - where do i read about that feature? |
# |
Aug 8th 2008, 22:49 |
markstory |
if you want to get really fancy bake can use custom templates. saving you more work :) |
# |
Aug 8th 2008, 22:48 |
M4ngoB00M |
yeah - big project |
# |
Aug 8th 2008, 22:48 |
markstory |
M4ngoB00M: thats a pretty big app :) |
# |
Aug 8th 2008, 22:47 |
M4ngoB00M |
yes - from http://book.cakephp.org I have read sections 1, 2 and 3 |
# |
Aug 8th 2008, 22:46 |
markstory |
book.cakephp.org and api.cakephp.org |
# |
Aug 8th 2008, 22:45 |
M4ngoB00M |
yes - i see the docs and have been systematically reading |
# |
Aug 8th 2008, 22:45 |
M4ngoB00M |
ahh -- i c |