Re: What is the 2nd parameter for in the __ function?

2012-05-04 Thread Xoubaman
Yes, it's ok.

The point is, you can use __('User %s was not found.', $username) and the 
%s will be replaced with the value in $username, or with __('User %s from 
%s was not found.', $username, $country) you'll get, for example, "User 
John from Jamaica was not found".

El viernes, 4 de mayo de 2012 19:38:27 UTC+2, Daniel escribió:
>
> I'm using Cake 2.0, so this is OK, right? 
> $this->Session->setFlash(__('User was not found.'));

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: What is the 2nd parameter for in the __ function?

2012-05-04 Thread Daniel
I'm using Cake 2.0, so this is OK, right?
$this->Session->setFlash(__('User was not found.'));

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: What is the 2nd parameter for in the __ function?

2012-05-04 Thread Xoubaman
In Cake >= 2.0 the second (and further) params are used to replace the %s 
present in the first one, like in the sprintf PHP function.

In Cake <= 1.3 if you omit the second parameter the function will echo the 
first one, if you set it to true will return it as a string.

El viernes, 4 de mayo de 2012 18:03:36 UTC+2, Daniel escribió:
>
> What is the 2nd parameter for in the __ function?  I don't understand 
> what it says in the manual. 
> For example should I use: 
> $this->Session->setFlash(__('User was not found.', true)); 
> or just: 
> $this->Session->setFlash(__('User was not found.')); 
> ? 
>
> Thanks, 
> Daniel

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php