I'm trying to make a simple application with no Framwork to put into practice some concepts I've learned.
I studied a lot on back-end with emphasis on OOP, but when I went to index.php
the questions came up:
- What now?
- Is it anyway?
- Do you have to summarize this part?
Question 1:
I've read in some places that it's okay to generate the values in Json
to make it easier to maintain, but honestly, I never quite understood. I know what I should do in Json
, I do whenever possible but for me Json
is just a bunch of keys that we send to someone. Can you give me an example where people convert Json
to HTML
?
Question 2:
The way I'm doing it is as follows:
<HTML>
<HEAD>
<?php
require_once("autoload.php");
$r = new objeto();
$r->GerarNome("zezinho");
?>
</HEAD>
<BODY>
<H1> <?php $r;//mostra "zezinho" ?> </H1>
</BODY>
<HTML/>
I'm loading as requires and creating objects in head (In my case they are only data like names that will have in my application). The results are coming but I feel like I'm completely wrong, that feeling of not doing the right thing. I wanted to know if I am doing well, if I am completely wrong, if I have to do otherwise.
If you have a new form, or something that you advise me to study, you can say that I want to do everything possible for good practice!