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 <[email protected]> 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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---