Re: include model data in other views?

2008-06-18 Thread villas

Hi Steve,

I suppose you already read this section of the 'book'.  If not,  it
may also be helpful:

http://book.cakephp.org/view/94/views#elements-97

On Jun 17, 2:54 pm, steve <[EMAIL PROTECTED]> wrote:
> Thanks Daniel - I did think of that, but ideally I'd like to be able
> to make a self-contained module out of the box that could be dropped
> anywhere if need be. Is the problem with requestAction that it has to
> traverse back up the tree to get to the data it needs, leading to
> slower load times/stress on the system/etc?
>
> On Jun 17, 1:31 am, Daniel Hofstetter <[EMAIL PROTECTED]> wrote:
>
> > Hi Steve,
>
> > > I am brand new to Cake and am trying to figure out what probably is a
> > > very simple problem. I have a News and Events page which has a model
> > > and controller spitting out all the news from the database, but I also
> > > have a separate static page stored in the pages directory that has
> > > mostly static content  but a dynamic News and Events callout box that
> > > lists the 3 latest news items. It seems silly to create another model/
> > > controller for this mostly static view just to get info that could be
> > > pulled directly from the News and Events model, but I'm struggling on
> > > how to do this. I've been reading on requestAction but have also heard
> > > people saying that was a poor way of accomplishing what I want to
> > > accomplish. As I'd like to learn the correct way to do it from the
> > > outset,  any ideas would be greatly appreciated, thanks.
>
> > An idea is to add an additional method to your controller (which also
> > means the view has to be moved away from the pages directory).
>
> > Hope that's enough to get you started ;-)
>
> > --
> > Daniel Hofstetterhttp://cakebaker.42dh.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: include model data in other views?

2008-06-17 Thread Daniel Hofstetter

Hi Steve,

> Thanks Daniel - I did think of that, but ideally I'd like to be able
> to make a self-contained module out of the box that could be dropped
> anywhere if need be. Is the problem with requestAction that it has to
> traverse back up the tree to get to the data it needs, leading to
> slower load times/stress on the system/etc?

Yes, requestAction is like a second request. If you use it once, it is
probably no problem, but it's best if you test it to see whether it
has a negative impact on your application.

--
Daniel Hofstetter
http://cakebaker.42dh.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: include model data in other views?

2008-06-17 Thread steve

Thanks Daniel - I did think of that, but ideally I'd like to be able
to make a self-contained module out of the box that could be dropped
anywhere if need be. Is the problem with requestAction that it has to
traverse back up the tree to get to the data it needs, leading to
slower load times/stress on the system/etc?

On Jun 17, 1:31 am, Daniel Hofstetter <[EMAIL PROTECTED]> wrote:
> Hi Steve,
>
> > I am brand new to Cake and am trying to figure out what probably is a
> > very simple problem. I have a News and Events page which has a model
> > and controller spitting out all the news from the database, but I also
> > have a separate static page stored in the pages directory that has
> > mostly static content  but a dynamic News and Events callout box that
> > lists the 3 latest news items. It seems silly to create another model/
> > controller for this mostly static view just to get info that could be
> > pulled directly from the News and Events model, but I'm struggling on
> > how to do this. I've been reading on requestAction but have also heard
> > people saying that was a poor way of accomplishing what I want to
> > accomplish. As I'd like to learn the correct way to do it from the
> > outset,  any ideas would be greatly appreciated, thanks.
>
> An idea is to add an additional method to your controller (which also
> means the view has to be moved away from the pages directory).
>
> Hope that's enough to get you started ;-)
>
> --
> Daniel Hofstetterhttp://cakebaker.42dh.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: include model data in other views?

2008-06-16 Thread Daniel Hofstetter

Hi Steve,

> I am brand new to Cake and am trying to figure out what probably is a
> very simple problem. I have a News and Events page which has a model
> and controller spitting out all the news from the database, but I also
> have a separate static page stored in the pages directory that has
> mostly static content  but a dynamic News and Events callout box that
> lists the 3 latest news items. It seems silly to create another model/
> controller for this mostly static view just to get info that could be
> pulled directly from the News and Events model, but I'm struggling on
> how to do this. I've been reading on requestAction but have also heard
> people saying that was a poor way of accomplishing what I want to
> accomplish. As I'd like to learn the correct way to do it from the
> outset,  any ideas would be greatly appreciated, thanks.

An idea is to add an additional method to your controller (which also
means the view has to be moved away from the pages directory).

Hope that's enough to get you started ;-)

--
Daniel Hofstetter
http://cakebaker.42dh.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



include model data in other views?

2008-06-16 Thread steve

I am brand new to Cake and am trying to figure out what probably is a
very simple problem. I have a News and Events page which has a model
and controller spitting out all the news from the database, but I also
have a separate static page stored in the pages directory that has
mostly static content  but a dynamic News and Events callout box that
lists the 3 latest news items. It seems silly to create another model/
controller for this mostly static view just to get info that could be
pulled directly from the News and Events model, but I'm struggling on
how to do this. I've been reading on requestAction but have also heard
people saying that was a poor way of accomplishing what I want to
accomplish. As I'd like to learn the correct way to do it from the
outset,  any ideas would be greatly appreciated, thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---