0
I’m trying to make a simple application without any Framwork to put into practice some concepts I learned.
I studied a lot about back-end with an emphasis on POO, but when I went to index.php
the questions came up:
- And now?
- Is that the way it is?
- Do you have to summarize that part?
Question 1:
I read in some places that the right thing is to generate the values in Json
to facilitate maintainability, but honestly never understood very well. I know what I must do in Json
, I do it whenever possible but for me Json
is just a bunch of keys we send to someone. Can you give me an example where people convert the Json
in HTML
?
Question 2:
The way I’m doing it is this:
<HTML>
<HEAD>
<?php
require_once("autoload.php");
$r = new objeto();
$r->GerarNome("zezinho");
?>
</HEAD>
<BODY>
<H1> <?php $r;//mostra "zezinho" ?> </H1>
</BODY>
<HTML/>
I am loading the requires and creating objects in the head (In my case they are only given as names they will have in my application). The results are coming but I feel like I’m completely wrong, that feeling of not doing it the right way. I wanted to know if I’m doing well, if I’m completely wrong, if I have to do it differently.
If you have a new form, or something that you recommend me to study, you can tell me that I want to do everything possible for good practice!
The idea is to separate the responsibilities (what happens on the back and the front), so changes in one do not directly affect the other, usually the front is done with some framework like Vue, angular or React
– Costamilam