Sunday, October 26, 2008

Re: user name on default.ctp

You can use $session->read('Auth.User') and/or $session-
>read('Auth.User.username') in the view.
Also, do NOT echo any HTML from the controller. It violates the MVC
pattern and the echo'd HTML will always come before anything else,
i.e. even before <html>, which is even wronger.

Chrs,
Dav

On 27 Oct 2008, at 03:54, carlos ferrandis wrote:

>
> btw, I've done that on my appcontroller
>
> echo "<div id='dataesaudacao'>";
> echo $this->Auth->user('name');
> echo "</div>";
>
> and it works. But, I don't know why I don't think is the correct
> approach.
>
> thanks for any help
>
> carlos
> >


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