title: How to combine JMVC (javascript-mvc) and server side MVC together
body: <p>I have asked this quesion few days before here and no one answered it.
  <br />
  I had asked it in <code>forum.javascriptMVC.com</code> too and now I have a answer, however I need a a bit more idea.</p>
  
  <p>Question:</p>
  
  <pre><code>I read javascriptMVC's documents and I loved it. 
  But I don't know how to use it in a large scale project.
  </code></pre>
  
  <p>I think on the server-side a MVC framework is needed or can help so much. And I've worked with server side PHP frameworks.</p>
  
  <p>I am confused, my understanding of JavascriptMVC projects is that they handle client side events on the browser capture events, execute  AJAX requests, manage the responses/data from the server and also show them to user in a graphical interface. </p>
  
  <p>I know that in PHP MVC projects we also have controllers (and actions) that any of them is a separate page with a single entry point, my point is that these pages are whole HTTP requests.</p>
  
  <p>I think the combination of these two frameworks would be in a form of a <strong>single</strong> or <em>few</em> heavy files (including js , css , imgs etc) that loads and managed by another Javascript libary such as steal.js. 
  Now user can work with site and its actions (as events) that result in running js functions that may change something in the UI or cause a AJAX request, as in Yahoo Mail where most things happens in <em>one</em> page.</p>
  
  <p>So how will this affect the design of controllers and actions in PHP ? I mean normally in PHP MVC frameworks a lot of controllers and actions means a lot of pages. I think because of AJAX the number of controllers and actions should be actually less. I also think because of JMVC most controllers (and actions) should turn to AJAX responders, however how are layouts and views to be handled in this context?</p>
  
  <p>Finally</p>
  
  <ul>
  <li>I want to know about different aspects of using this method(JMVC+MVC). (I am using Yii as my server-side MVC framework and JavascriptMVC as my client-side MVC). </li>
  <li>I also want to know about management of data on the client-side.</li>
  <li>I would like to understand how AJAX and web-sockets could be used, where we can use AJAX and where we can use websockets?. </li>
  <li>I want to understand about local-storage how we can use it for simulated page data management and maybe caching, how we can cache data coming from server as JSON in a form of a page? I am working on a very large project and I want to build its foundation very strong.</li>
  </ul>