Re: 'set' and 'render' together? access set variables from different view?

2009-07-26 Thread Josh

I figured out my problem: there was a redirect statement later in the
action that was redirecting to 'differentaction' and thus clearing the
viewVars.

Thanks.

On Jul 26, 12:49 pm, Josh  wrote:
> Brian the actual variable is $a, no underscores.
>
> Maybe I wasn't clear in my earlier post.
>
> e.g.
>
> //exampleController - someaction
>
>                 $a = 'a';
>                 $this->set('a', $a);
>                 $this->render('differentaction');
>
> //differentaction.ctp
>
>                 ;
>
> Should this work?
>
> On Jul 26, 11:00 am, brian  wrote:
>
> > Is there an underscore in the actual variable name?
>
> > On Sun, Jul 26, 2009 at 12:40 AM, Josh wrote:
>
> > > This seems like a very simple question, but I have been struggling
> > > with it for quite a while. How can I use the 'set' function and then
> > > the 'render' function while still being able to access my set
> > > variables from the view? It seems to me that 'set' only makes
> > > variables available in the view that matches the action. How can I get
> > > around this?
>
> > > e.g.
>
> > > //exampleController
>
> > >                $this->set('a', $a);
> > >                $this->render('index');
>
> > > //index.ctp
>
> > >                ;
--~--~-~--~~~---~--~~
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: 'set' and 'render' together? access set variables from different view?

2009-07-26 Thread Josh

Brian the actual variable is $a, no underscores.

Maybe I wasn't clear in my earlier post.

e.g.

//exampleController - someaction

$a = 'a';
$this->set('a', $a);
$this->render('differentaction');

//differentaction.ctp

;



Should this work?



On Jul 26, 11:00 am, brian  wrote:
> Is there an underscore in the actual variable name?
>
> On Sun, Jul 26, 2009 at 12:40 AM, Josh wrote:
>
> > This seems like a very simple question, but I have been struggling
> > with it for quite a while. How can I use the 'set' function and then
> > the 'render' function while still being able to access my set
> > variables from the view? It seems to me that 'set' only makes
> > variables available in the view that matches the action. How can I get
> > around this?
>
> > e.g.
>
> > //exampleController
>
> >                $this->set('a', $a);
> >                $this->render('index');
>
> > //index.ctp
>
> >                ;
--~--~-~--~~~---~--~~
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: 'set' and 'render' together? access set variables from different view?

2009-07-26 Thread brian

Is there an underscore in the actual variable name?

On Sun, Jul 26, 2009 at 12:40 AM, Josh wrote:
>
> This seems like a very simple question, but I have been struggling
> with it for quite a while. How can I use the 'set' function and then
> the 'render' function while still being able to access my set
> variables from the view? It seems to me that 'set' only makes
> variables available in the view that matches the action. How can I get
> around this?
>
> e.g.
>
> //exampleController
>
>                $this->set('a', $a);
>                $this->render('index');
>
> //index.ctp
>
>                ;
>
> >
>

--~--~-~--~~~---~--~~
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: 'set' and 'render' together? access set variables from different view?

2009-07-26 Thread Jaydeep Dave
There is something wrong with you variable or index.ctp

otherwise the code, u have shown should work properly.

Jaydeep Dave

On Sat, Jul 25, 2009 at 8:40 PM, Josh  wrote:

>
> This seems like a very simple question, but I have been struggling
> with it for quite a while. How can I use the 'set' function and then
> the 'render' function while still being able to access my set
> variables from the view? It seems to me that 'set' only makes
> variables available in the view that matches the action. How can I get
> around this?
>
> e.g.
>
> //exampleController
>
>$this->set('a', $a);
>$this->render('index');
>
> //index.ctp
>
>;
>
> >
>


-- 
Regards,

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