# |
Aug 6th 2008, 22:06 |
cobol |
i dont really know |
# |
Aug 6th 2008, 22:06 |
cobol |
i think? |
# |
Aug 6th 2008, 22:05 |
cobol |
i would wager because your controller explicitly uses('Post')? |
# |
Aug 6th 2008, 22:05 |
Jezek |
gotcha |
# |
Aug 6th 2008, 22:05 |
nymacro |
in regards to [Post] |
# |
Aug 6th 2008, 22:05 |
nymacro |
can anyone tell my why CakePHP behaves like this: http://bin.cakephp.org/view/1570690605 |
# |
Aug 6th 2008, 22:04 |
cobol |
the action takes the data and passes it to the view |
# |
Aug 6th 2008, 22:04 |
cobol |
from the action |
# |
Aug 6th 2008, 22:04 |
cobol |
and calling on that component |
# |
Aug 6th 2008, 22:04 |
cobol |
Jezek: by putting the application logic that fetches it into a component |
# |
Aug 6th 2008, 22:04 |
achew22 |
rar.... |
# |
Aug 6th 2008, 22:03 |
Jezek |
but how do i get the data into the element without using requestAction |
# |
Aug 6th 2008, 22:03 |
cobol |
and the component is application logic |
# |
Aug 6th 2008, 22:03 |
cobol |
so helpers and elements become the view logic code |
# |
Aug 6th 2008, 22:03 |
nymacro |
hmmm |
# |
Aug 6th 2008, 22:03 |
cobol |
it's basically the same thing, except for reusable code |
# |
Aug 6th 2008, 22:03 |
Jezek |
yes |
# |
Aug 6th 2008, 22:03 |
cobol |
well you know how in MVC, application logic goes in the controller, and view logic in the views? |
# |
Aug 6th 2008, 22:02 |
Jezek |
not really |
# |
Aug 6th 2008, 22:02 |
cobol |
does that all make sense? |
# |
Aug 6th 2008, 22:02 |
Jezek |
oh ok |
# |
Aug 6th 2008, 22:02 |
cobol |
*becomes |
# |
Aug 6th 2008, 22:02 |
cobol |
and it because a black box to the controller's action |
# |
Aug 6th 2008, 22:01 |
cobol |
you could then also easily integrate data caching in the component |
# |
Aug 6th 2008, 22:01 |
cobol |
where the element handles it |
# |
Aug 6th 2008, 22:01 |
cobol |
and pass it along to the view |
# |
Aug 6th 2008, 22:01 |
cobol |
the application logic i would likely put in a component. the pages that use it would then call on the component to generate the data |
# |
Aug 6th 2008, 22:01 |
cobol |
Jezek: no, the element is the view logic component |
# |
Aug 6th 2008, 22:00 |
Jezek |
cobol, wouldn't i have to use requestaction in the element? |
# |
Aug 6th 2008, 21:59 |
Jezek |
prettyy sure this is the cakephp channel |
# |
Aug 6th 2008, 21:58 |
loki_racer |
whats another site like Pandora, not last.fm, that uses the browser to delivery music |
# |
Aug 6th 2008, 21:58 |
Jezek |
alright |
# |
Aug 6th 2008, 21:57 |
cobol |
like for example a component, or helpers, or elements; as is appropriate for you |
# |
Aug 6th 2008, 21:57 |
cobol |
i.e. you should find a different container for reusable application logic components for that instead of an action |
# |
Aug 6th 2008, 21:56 |
cobol |
there are a number of ways you can do this, but requestAction is probably not what you wnat to be doign because of the weight |
# |
Aug 6th 2008, 21:56 |
chrysanthemum |
well hello all |
# |
Aug 6th 2008, 21:56 |
cobol |
or somesuch |
# |
Aug 6th 2008, 21:56 |
cobol |
<?php echo $this->element('categorylist'); ?> |
# |
Aug 6th 2008, 21:55 |
cobol |
an element would be a reusable piece of view logic |
# |
Aug 6th 2008, 21:55 |
Jezek |
so i just include the copmonent in the controller? |
# |
Aug 6th 2008, 21:55 |
Jezek |
but what if i want to use views too, like if viewing an individual category |