Monday, October 27, 2008

Re: user name on default.ctp

Hi Andrea

Would mind explaining why would be better to create and Element instead
of putting this inside of my default.ctp and also if you can please post
the code for the solution.

thanks a lot

Carlos

Kappa escreveu:
> Anyway that's the case in which you should consider creating an
> Element to render inside the layout,
> generally it's not a very nice thing to put that kind output inside
> the layout.
>
> bye,
> Andrea
>
> On Oct 27, 11:53 am, Carlos <bicimu...@gmail.com> wrote:
>
>> Thanks
>> I must be very bad because I spent the whole Sunday to create my "wrong"
>> solution and you pointed to me a perfect one in 10 seconds. At least now
>> I know a little bit more than I knew Sunday.
>>
>> thanks
>>
>> David C. Zentgraf escreveu:
>>
>>
>>> 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: