RE: requestAction question

2011-02-27 Thread Krissy Masters
I ended up doing just that.

Thanks all,

K


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: requestAction question

2011-02-27 Thread Dr. Loboto
So my first assumption was right - you need to have common element in
non-AJAX layout. In this case all you need is call model function
Apple::getAppleInfo() in AppController beforeFilter/beforeRender that
will retrieve and set data for view and put $this-
>element('show_apples') into layout. And no any need for
requestAction, just simple model call and element output. Or, if logic
of your current ApplesController::getAppleInfo() is too complex for
model, put it into component and use it in AppController.

On Feb 25, 11:46 pm, "Krissy Masters" 
wrote:
> LOL sorry.
>
> Try this again.
> Imagine a 2 col layout left side is nav and under the nav are pictures of 4
> apples with text / size / price (these apple details are pulled when you
> visit apples page / the index of apples.com)
>
> The sidenav has Apples / Oranges / Peaches
>
> You click on oranges it ajax loads oranges into the main col so the left
> side never changed (good) But oranges has nothing to do with apples so you
> do not get any apple info but since the left side never changed because the
> link was ajax the 4 apples are still there as they were (good)
>
> Right click / bookmark open a oranges or peaches pages directly with HTTP
> request your loading a fresh template / layout and apple element with the
> apple element on the side but no apple info is pulled since its not related
> at all. I need to get apple info on every page no matter what page your on,
> or how you get to it so I figured if the apple element said to itself
> everytime its loaded getAppleInfo() with requestAction this would solve the
> problem. (some apples might be sold out, not in season) so apple data
> changes thru out the users visit when http requests are made (other links
> besides Oranges and Peaches)
>
> **I know about caching just left it out to not complicate thing even more
>
> Hope that gives you a better idea.
>
> Thanks.
>
> K
>
>
>
>
>
>
>
> -Original Message-
> From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
>
> Of Dr. Loboto
> Sent: Friday, February 25, 2011 11:25 AM
> To: CakePHP
> Subject: Re: requestAction question
>
> Now I don't understand what do you need. Change other part of page
> when load something by AJAX? Just make other AJAX request to update
> this part too.
>
> --
> Our newest site for the community: CakePHP Video 
> Tutorialshttp://tv.cakephp.org
> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> others with their CakePHP related questions.
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


RE: requestAction question

2011-02-25 Thread Krissy Masters
LOL sorry.

Try this again. 
Imagine a 2 col layout left side is nav and under the nav are pictures of 4
apples with text / size / price (these apple details are pulled when you
visit apples page / the index of apples.com)

The sidenav has Apples / Oranges / Peaches

You click on oranges it ajax loads oranges into the main col so the left
side never changed (good) But oranges has nothing to do with apples so you
do not get any apple info but since the left side never changed because the
link was ajax the 4 apples are still there as they were (good)

Right click / bookmark open a oranges or peaches pages directly with HTTP
request your loading a fresh template / layout and apple element with the
apple element on the side but no apple info is pulled since its not related
at all. I need to get apple info on every page no matter what page your on,
or how you get to it so I figured if the apple element said to itself
everytime its loaded getAppleInfo() with requestAction this would solve the
problem. (some apples might be sold out, not in season) so apple data
changes thru out the users visit when http requests are made (other links
besides Oranges and Peaches)

**I know about caching just left it out to not complicate thing even more

Hope that gives you a better idea.

Thanks.

K


-Original Message-
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Dr. Loboto
Sent: Friday, February 25, 2011 11:25 AM
To: CakePHP
Subject: Re: requestAction question

Now I don't understand what do you need. Change other part of page
when load something by AJAX? Just make other AJAX request to update
this part too.

-- 
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help
others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: requestAction question

2011-02-25 Thread Dr. Loboto
Now I don't understand what do you need. Change other part of page
when load something by AJAX? Just make other AJAX request to update
this part too.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


RE: requestAction question

2011-02-24 Thread Krissy Masters
Not sure I follow you there. The element on the side only gets refreshed if 
loaded thru standard HTTP request.

Page A, B and C are different controller actions unrelated to each other so to 
get that data for each page if loaded thru HTTP will require getting unrelated 
models data if done thru the controllers action. No? Maybe not following you 
there...sorry if I'm wrong.

K

-Original Message-
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of 
Dr. Loboto
Sent: Friday, February 25, 2011 12:40 AM
To: CakePHP
Subject: Re: requestAction question

Based on your description I do not see need in requestAction at all.
If all you need is 1 model call and one element output you can add
data call to appropriate actions or beforeFilter/beforeRender and add
element output to the view/layout. Just one more line of code in
comparison with requestAction.

On 25 фев, 06:21, "Krissy Masters"  wrote:
> Maybe I read it wrong back in the day but something idles in my head about
> requestAction being bad. Is this true or still in effect? I am using 1.3.7
> and I think I remember reading back in 1.2 its better to not use that
> function.
>
> “If used without caching requestAction can lead to poor performance. It is
> rarely appropriate to use in a controller or model.”
>
> I have 1 element on 3 pages where I simply need to grab 4 fields from a db
> for the element. The element is loaded originally on the first page left
> side navigation column, and links load content into the main column so the
> element is never refreshed since its on the side nav column except if
> someone “open in new tab / window” on the link so the element has no data
> because its originally loaded on the main page. So rather than build that
> data call into each of those 3 pages I figured request would be the best
> option.
>
> My Picasso below :)
>
> Side Col  |   Main Col
> ___
> | nav => loads into main  |   content gets loaded here via ajax
> |--|
> |
> | element |
> |
> 
>
> Just looking for some input on the matter.
>
> Thanks,
>
> K

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: requestAction question

2011-02-24 Thread Dr. Loboto
Based on your description I do not see need in requestAction at all.
If all you need is 1 model call and one element output you can add
data call to appropriate actions or beforeFilter/beforeRender and add
element output to the view/layout. Just one more line of code in
comparison with requestAction.

On 25 фев, 06:21, "Krissy Masters"  wrote:
> Maybe I read it wrong back in the day but something idles in my head about
> requestAction being bad. Is this true or still in effect? I am using 1.3.7
> and I think I remember reading back in 1.2 its better to not use that
> function.
>
> “If used without caching requestAction can lead to poor performance. It is
> rarely appropriate to use in a controller or model.”
>
> I have 1 element on 3 pages where I simply need to grab 4 fields from a db
> for the element. The element is loaded originally on the first page left
> side navigation column, and links load content into the main column so the
> element is never refreshed since its on the side nav column except if
> someone “open in new tab / window” on the link so the element has no data
> because its originally loaded on the main page. So rather than build that
> data call into each of those 3 pages I figured request would be the best
> option.
>
> My Picasso below :)
>
> Side Col                  |       Main Col
> ___
> | nav => loads into main  |   content gets loaded here via ajax
> |--|
> |
> | element                 |
> |
> 
>
> Just looking for some input on the matter.
>
> Thanks,
>
> K

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


RE: requestAction question

2011-02-24 Thread Krissy Masters
Thanks.

I am half way thru deciding. I am building a function just to get those 4
fields and cache the data. requestAction might come next depending on how I
feel. requestAction in my case would only be called if the user wants to
open the page in a new Window why is beyond me but I can not predict the
habits of every user.

Thanks guys.

K

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Larry E. Masters
Sent: Thursday, February 24, 2011 11:42 PM
To: cake-php@googlegroups.com
Subject: Re: requestAction question

When used properly it has it uses. But I did not think people would use it
the way they do when I added it the core.

http://mark-story.com/posts/view/how-using-requestaction-increased-performan
ce-on-my-site


-- 
Larry E. Masters 

On Thu, Feb 24, 2011 at 8:31 PM, Sam Sherlock 
wrote:
Andy Gale mentions that requestAction was not an option for use in a large
scale site (in video on the tv site)

http://mark-story.com/posts/view/reducing-requestaction-use-in-your-cakephp-
sites-with-fat-models

this article by teknoid is about menu specifically - I just found it &
bookmarked it
http://nuts-and-bolts-of-cakephp.com/2008/08/20/dynamic-menus-without-reques
taction-in-cakephp-12/

 - S



On 25 February 2011 00:21, Krissy Masters 
wrote:
Maybe I read it wrong back in the day but something idles in my head about
requestAction being bad. Is this true or still in effect? I am using 1.3.7
and I think I remember reading back in 1.2 its better to not use that
function.

“If used without caching requestAction can lead to poor performance. It is
rarely appropriate to use in a controller or model.”

I have 1 element on 3 pages where I simply need to grab 4 fields from a db
for the element. The element is loaded originally on the first page left
side navigation column, and links load content into the main column so the
element is never refreshed since its on the side nav column except if
someone “open in new tab / window” on the link so the element has no data
because its originally loaded on the main page. So rather than build that
data call into each of those 3 pages I figured request would be the best
option.

My Picasso below :)


Side Col                  |       Main Col
___
| nav => loads into main  |   content gets loaded here via ajax
|--|
|
| element                 |
|




Just looking for some input on the matter.

Thanks,

K

--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help
others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help
others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help
others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: requestAction question

2011-02-24 Thread Larry E. Masters
When used properly it has it uses. But I did not think people would use it
the way they do when I added it the core.

http://mark-story.com/posts/view/how-using-requestaction-increased-performance-on-my-site


-- 
Larry E. Masters


On Thu, Feb 24, 2011 at 8:31 PM, Sam Sherlock wrote:

> Andy Gale mentions that requestAction was not an option for use in a large
> scale site (in video on the tv site)
>
>
> http://mark-story.com/posts/view/reducing-requestaction-use-in-your-cakephp-sites-with-fat-models
>
> this article by teknoid is about menu specifically - I just found it &
> bookmarked it
>
> http://nuts-and-bolts-of-cakephp.com/2008/08/20/dynamic-menus-without-requestaction-in-cakephp-12/
>
>  - S
>
>
>
>
> On 25 February 2011 00:21, Krissy Masters wrote:
>
>> Maybe I read it wrong back in the day but something idles in my head about
>> requestAction being bad. Is this true or still in effect? I am using 1.3.7
>> and I think I remember reading back in 1.2 its better to not use that
>> function.
>>
>> “If used without caching requestAction can lead to poor performance. It is
>> rarely appropriate to use in a controller or model.”
>>
>> I have 1 element on 3 pages where I simply need to grab 4 fields from a db
>> for the element. The element is loaded originally on the first page left
>> side navigation column, and links load content into the main column so the
>> element is never refreshed since its on the side nav column except if
>> someone “open in new tab / window” on the link so the element has no data
>> because its originally loaded on the main page. So rather than build that
>> data call into each of those 3 pages I figured request would be the best
>> option.
>>
>> My Picasso below :)
>>
>>
>> Side Col  |   Main Col
>> ___
>> | nav => loads into main  |   content gets loaded here via ajax
>> |--|
>> |
>> | element |
>> |
>> 
>>
>>
>>
>> Just looking for some input on the matter.
>>
>> Thanks,
>>
>> K
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: requestAction question

2011-02-24 Thread Sam Sherlock
Andy Gale mentions that requestAction was not an option for use in a large
scale site (in video on the tv site)

http://mark-story.com/posts/view/reducing-requestaction-use-in-your-cakephp-sites-with-fat-models

this article by teknoid is about menu specifically - I just found it &
bookmarked it
http://nuts-and-bolts-of-cakephp.com/2008/08/20/dynamic-menus-without-requestaction-in-cakephp-12/

 - S




On 25 February 2011 00:21, Krissy Masters wrote:

> Maybe I read it wrong back in the day but something idles in my head about
> requestAction being bad. Is this true or still in effect? I am using 1.3.7
> and I think I remember reading back in 1.2 its better to not use that
> function.
>
> “If used without caching requestAction can lead to poor performance. It is
> rarely appropriate to use in a controller or model.”
>
> I have 1 element on 3 pages where I simply need to grab 4 fields from a db
> for the element. The element is loaded originally on the first page left
> side navigation column, and links load content into the main column so the
> element is never refreshed since its on the side nav column except if
> someone “open in new tab / window” on the link so the element has no data
> because its originally loaded on the main page. So rather than build that
> data call into each of those 3 pages I figured request would be the best
> option.
>
> My Picasso below :)
>
>
> Side Col  |   Main Col
> ___
> | nav => loads into main  |   content gets loaded here via ajax
> |--|
> |
> | element |
> |
> 
>
>
>
> Just looking for some input on the matter.
>
> Thanks,
>
> K
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php