write php inside javascript alert -


i write php inside js in following way

alert(<?php echo __("error-login") ?>); 

echo__("error-login") correlates xml translate in 2 languages ​​with symfony, not work.

how fix this?

you missing quotes in alert() call.

alert('<?php echo __("error-login") ?>');  

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -