This works for views, but is it possible to pass variables to layouts?

I don't see anything about this in the docs, other than the standard
$title_for_layout and $content_for_layout.

Thanks.

On Apr 16, 1:42 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> in the controller
>             $testArray = Array('foo' => 'bar')
>             $this->set('testArray', $testArray);
>
> in the view
>     <?php print_r($testArray); ?>
>
> try that
>
> On 16/04/2008, Ithaka <[EMAIL PROTECTED]> wrote:
>
>
>
> > ...and???  Been looking at those sites, no sure what your trying to
> > point out.  Still trying to fix my problem.
>
> > On Apr 16, 1:58 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> > >http://tempdocs.cakephp.org/http://book.cakephp.org/
>
> > >http://cakebaker.42dh.com/2007/04/05/whats-new-in-cakephp-12/
>
> > > hth - S
>
> > > On 16/04/2008, Ithaka <[EMAIL PROTECTED]> wrote:
>
> > > > Hey guys,
>
> > > > I was wondering if anyone could help me out with this problem.  I am
> > > > currently running cakephp 1.2 and i wish to pass an array to my layout
> > > > so that i may use that array in a drop down list.  I have my drop down
> > > > list working but i'm having trouble getting my array to the layout.  I
> > > > looked at this blog (http://cake-php.blogspot.com/2006/09/21-things-
> > > > you-must-know-about-cakephp.html) but unfortunetely it's in 1.1 and
> > > > the command he uses (<? $this->_viewVars['somedata'] =
> > > > array('some','data'); ?> ) isn't working.  I've been searching around
>
> > > > the API but haven't found a solution yet.  Thanks in advance!- Hide
> > quoted text -
>
> > > - Show quoted text -

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to