Tuesday, April 17, 2012

Re: How to show message from default.po into javascript

This would create a global variable. A really basic example.

$code = 'var messages = {'
. 'msg1: '. __('some text here') .','
. 'msg2: '. __('some text here') .','
. 'msg3: '. __('some text here')
. '};';

$this->Html->scriptBlock($code, array('inline' => false));

alert(messages.msg1);

On Tue, Apr 17, 2012 at 7:52 AM, Marcus James <marcomtl@gmail.com> wrote:
> Hi,
>
> Can any one tell me how to read messages from default.po inside JavaScript.
>
>
>
>
>
>
>
>
> Thanks,
>
> Marcus
>
> --
> 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+unsubscribe@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate