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 <[email protected]> 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
> [email protected] 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
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to