Re: Total count of posts?

2010-06-07 Thread calvin
Just put it in the AppController (e.g. in beforeRender() or
beforeFilter()). That's what I do for my navigation variables.

On Jun 6, 3:49 am, saidbakr  wrote:
> Hi,
>
> What I meant is placing this in the layout to be available in all
> parts or pages of the application. I discovered that "requestAction()"
> method is able to do this in the layout.
> However, requestAction() method could not able to call private actions
> - Actions of name start with underscore _ such as _postcount.
>
> My question now is how to make requestAction able to call private
> action?
>
> On Jun 6, 4:20 am, Andras Kende  wrote:
>
> > Hello,
>
> > in the controller:
> > $this->set('postcount', $this->Post-find('count'));
>
> > in the view:
> > 
>
> > Andras
>
> > On Jun 5, 2010, at 6:34 PM, saidbakr wrote:
>
> > > Hi,
>
> > > How could I set dynamic data in the layout?
>
> > > In other word, I need to place the total count of posts in the layout
> > > footer.
>
> > > My application has posts controller and post model.
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
> > > with their CakePHP related questions.
>
> > > 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
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Total count of posts?

2010-06-06 Thread Sam Sherlock
no - requestAction  calls an action that calls the private method or you
make the method public

but it might be worth looking at other options too - then you don't need
requestAction
http://book.cakephp.org/view/74/Complex-Find-Conditions

- S


On 6 June 2010 11:49, saidbakr  wrote:

> Hi,
>
> What I meant is placing this in the layout to be available in all
> parts or pages of the application. I discovered that "requestAction()"
> method is able to do this in the layout.
> However, requestAction() method could not able to call private actions
> - Actions of name start with underscore _ such as _postcount.
>
> My question now is how to make requestAction able to call private
> action?
>
> On Jun 6, 4:20 am, Andras Kende  wrote:
> > Hello,
> >
> > in the controller:
> > $this->set('postcount', $this->Post-find('count'));
> >
> > in the view:
> > 
> >
> > Andras
> >
> > On Jun 5, 2010, at 6:34 PM, saidbakr wrote:
> >
> > > Hi,
> >
> > > How could I set dynamic data in the layout?
> >
> > > In other word, I need to place the total count of posts in the layout
> > > footer.
> >
> > > My application has posts controller and post model.
> >
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> others with their CakePHP related questions.
> >
> > > 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
> > > cake-php+unsubscr...@googlegroups.comFor
> > >  more options, visit this group athttp://
> groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Total count of posts?

2010-06-06 Thread saidbakr
Hi,

What I meant is placing this in the layout to be available in all
parts or pages of the application. I discovered that "requestAction()"
method is able to do this in the layout.
However, requestAction() method could not able to call private actions
- Actions of name start with underscore _ such as _postcount.

My question now is how to make requestAction able to call private
action?

On Jun 6, 4:20 am, Andras Kende  wrote:
> Hello,
>
> in the controller:
> $this->set('postcount', $this->Post-find('count'));
>
> in the view:
> 
>
> Andras
>
> On Jun 5, 2010, at 6:34 PM, saidbakr wrote:
>
> > Hi,
>
> > How could I set dynamic data in the layout?
>
> > In other word, I need to place the total count of posts in the layout
> > footer.
>
> > My application has posts controller and post model.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > 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
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Total count of posts?

2010-06-05 Thread Andras Kende
Hello,

in the controller:
$this->set('postcount', $this->Post-find('count'));

in the view:


Andras

On Jun 5, 2010, at 6:34 PM, saidbakr wrote:

> Hi,
> 
> How could I set dynamic data in the layout?
> 
> In other word, I need to place the total count of posts in the layout
> footer.
> 
> My application has posts controller and post model.
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Total count of posts?

2010-06-05 Thread saidbakr
Hi,

How could I set dynamic data in the layout?

In other word, I need to place the total count of posts in the layout
footer.

My application has posts controller and post model.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en