4
I’m working on a system that uses MVC as follows,
View -> HTML,CSS
Model -> PHP
Controller -> JS
Basically all system actions work by going through the following order:
User triggers some action on js it validates and sends to php, on php it makes the necessary queries and validations and returns to the js be able to update the html with the data.
My concern is that with the increase of the pages my layout gets more and more "Polluted, full of code repeats, totally Ante-DRY,rsrs."
To try to improve this situation, I created a file called funcoes.js, in it is the functions of general use, and the functions of startup of the app, for example:
versao();
validaUsuario();
permissoesUsuario();
favoritos();
and now
menu();
rodape();
This menu takes the file menu.html and click on every page that is a
<div id='menu'></div> using the function .load() of jQuery.
The footer works the same way.
But using load or append always some delay/failure of rendering html.
My doubts:
1° - It is possible to create a template type the blade of laravel using only HTML/JS/CSS?
2° - I know that to use routes we must have the mod_rewrite of php enabled and use the .htacess, how I could use routes using as reference my pattern MVC?
I found curious how you identified part of your MVC in the client (JS and CSS), part in the server (php) and part in both (HTML). Usually when talking about MVC, it is either the client architecture (Angular, Backbone, Ember) or the server architecture (Cakephp, Symfony, and Laravel itself, among many others).
– sergiopereira
of course, I started studying
laraveland saw that the structure was quite different, I do not see how something so bad this organization actually helps me a lot when it comes to providing maintenance.– Gabriel Rodrigues
I’m not even saying it’s bad. I’m sorry if it sounded that way.
– sergiopereira