I'm working on a system that uses MVC
as follows,
View -> HTML,CSS
Model -> PHP
Controller -> JS
Basically, all system actions work in the following order:
User triggers some action in js
it validates and sends to php, in php
it does the necessary queries and validations and returns to js
can update html
with data. >
My concern is that with the increase of the pages my layout
gets more and more "Polluted, full of code repetitions, totally Ante-DRY
, rsrs."
To try to improve this situation, I created a file called funcoes.js
, in it are the functions of general use, and the functions of initialization of the app, for example:
versao();
validaUsuario();
permissoesUsuario();
favoritos();
Now
menu();
rodape();
This menu takes the file menu.html
and loads all pages that are a <div id='menu'></div>
using the .load()
function of jQuery
.
The footer works the same way.
But using load
or append
always has some delay / render failure of html
.
My questions:
1 ° - Can you create a template
type blade
of laravel
using only HTML/JS/CSS
?
2 ° - I know that to use routes we must have mod_rewrite
of php
enabled and use .htacess
, how could I use routes using my default MVC
?