Wednesday, April 29, 2009

Re: Using several views for same controller function

Also take a look at element() and requestAction()

On Apr 28, 2:25 pm, Paco Gomez <paco.gomez.ar...@gmail.com> wrote:
> Thank you every body,
>
> Yes, I didn't explain very well what I want to do but with $this-
>
> >render('the_view'); solution I've resolved my question.
>
> Bye
>
> On 28 abr, 11:00, John Andersen <j.andersen...@gmail.com> wrote:
>
> > Don't let the controller know how to present information, let the view
> > itselt decide which information to present using elements!
>
> > So in the controller, provide the information to the view:
> > $this->set( "decsion", array("a" => $a, "b" = $b) );
>
> > And in the view:
> > if ( $decision["a"] == 0 ) {
> >    $this->element( 'element_to_show_the_a_information' );}
>
> > and so on for the "b".
>
> > Hope this helps,
> >    John
>
> > On Apr 28, 10:48 am, Paco Gomez <paco.gomez.ar...@gmail.com> wrote:
>
> > > Good morning,
>
> > > I don't know if I could use two diferent view for the same controller
> > > function, for example:
>
> > > class UsersController extends AppController {
>
> > >   function tes()
> > >   {
> > >      if(a==0)  //there I use view a.ctp
> > >      if (b==0) //there I use view b.ctp
> > >   }
>
> > > }
>
> > > Thank you in adavantage
--~--~---------~--~----~------------~-------~--~----~
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: