Wednesday, September 29, 2010

Re: Is it possible to get a query and display it to views/layouts/default.ctp? Cake 1.3?

I got it.

Add the variables on

function beforeFilter() {
        $cartcount = '123';
        $this->set(compact('cartcount'));
    }

on app/app_controller.php

It worked.
--
Louie Miranda
 - Email: lmiranda@gmail.com
 - Web: http://www.louiemiranda.com



On Thu, Sep 30, 2010 at 8:22 AM, Louie Miranda <lmiranda@gmail.com> wrote:
Data variables did not worked when placed on views/layouts/default.ctp?

--
Louie Miranda
 - Email: lmiranda@gmail.com
 - Web: http://www.louiemiranda.com



On Wed, Sep 29, 2010 at 3:54 PM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
Put it in an element - in fact your whole cart should be an element.

On 29 Sep 2010, at 08:25, Louie Miranda wrote:

Hi,

I have this shopping cart where I am trying to figure out how can I display a query (example numbers of items on cart) and display it on my views/layouts/default.ctp file?

Image
http://i141.photobucket.com/albums/r50/louiemiranda/debug/shopcart.png

On a normal controller, I would just add this on $this->set. Now, since views/layouts/default.ctp does not have a main controller, how can I propagate date with it?

Any ideas is appreciated.
--
Louie Miranda
 - Email: lmiranda@gmail.com
 - Web: http://www.louiemiranda.com


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

No comments: