title: PHP - generating JavaScript
body: <p>I am working on a project which has a lot of JavaScript. I think that generating simple strings and putting them between "&lt;script&gt;" tags is not the best way to do it.</p>
  
  <p>Are there any better approaches to generate JavaScript objects, functions, calls etc? Maybe some convering classes (from PHP to JavaScript) or maybe there are design patterns I should follow?</p>
  
  <p>PS. If it has any relevance - I am using MooTools with MochaUI (with MochaPHPControl).</p>
  
  <p>Thanks in advance for the help.</p>