How to structure Javascript architecture in addition to PHP MVC web application?

I am working on a new JavaScript architecture for iterating web applications. In the previous iteration, there was a lot of embedded code, the scattered ones included, no directory structure for .js files, and everything was in the global namespace. I want: save the script in the footer, save everything in the namespace / objects of the application, add the organization to .js files and minimize all application files in one bundle.js package

I am trying to take a modular approach based on Nicholas Zakas: "Scalable JavaScript Application Architecture" http://www.yuiblog.com/blog/2009/09/17/video-bayjax-sept-09/

the site is currently structured like this

/app
 /models
 /views
   /home
   /auth
   /meta
     about.tpl
     contact.tpl
     privacy.tpl
 /controllers
   home.php
   auth.php
   meta.php
 /public
  /js
   core.js
   /modules
     module files here
   /jquery
     jqueryplugins here
   /controllers
     home.js
     auth.js
     meta.js

, URL . , http://localhost/meta/contact "" "meta" /.

js , , ..

localwebapp.init(controller, method);

. , , . , "", , .

, . , .

, . . javascript MVC, JavaScriptMVC, , ,

+3
1

JavaScript MVC. .

, - (ZF MVC) - REST API JavaScript MVC . - PHP, , JavaScript MVC, ..

, , .

, MVC , - . XML JSON. , , , , .

JavaScript MVC - , MVC ( ), , , , .

, !

+1

Source: https://habr.com/ru/post/1720422/


All Articles