progetto fatto precedentemente adattato al framework creato con il corso
15e03a88fa42f2444138ebc6f171c9a32a3a4238..effd6a73291031fd0ab48cc331294b20279f0840
2024-06-05 filippo.bertilotti
test render
effd6a diff | tree
1 files deleted
4 files added
1 files modified
43 ■■■■■ changed files
src/App/Controllers/fiat.php 7 ●●●●● patch | view | raw | blame | history
views/Fiat/base.mvc.php 12 ●●●●● patch | view | raw | blame | history
views/Fiat/footer.mvc.php 5 ●●●●● patch | view | raw | blame | history
views/Fiat/header.mvc.php 8 ●●●●● patch | view | raw | blame | history
views/Fiat/index.mvc.php 11 ●●●●● patch | view | raw | blame | history
views/Fiat/index.php patch | view | raw | blame | history
src/App/Controllers/fiat.php
@@ -1,11 +1,10 @@
<?php
namespace App\Controllers;
use Framework\Controller;
class Home extends Controller {
class Fiat extends Controller {
    public function index() {
        echo $this->viewer->render("shared/header.php");
        echo $this->viewer->render("Home/index.php");
        return $this->view("Fiat/index.mvc.php", [
        ]);
    }
}
views/Fiat/base.mvc.php
New file
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Home</title>
    <link rel="stylesheet" href="files_comuni/style/style.css">
</head>
<body>
    {% yield body %}
</body>
</html>
views/Fiat/footer.mvc.php
New file
@@ -0,0 +1,5 @@
<footer>
    <hr>
    author: me
    copyright
</footer>
views/Fiat/header.mvc.php
New file
@@ -0,0 +1,8 @@
<header>
    <h1>TEST HEADER</h1>
    <a href="/fiat/index">Home</a>
    <a href="/fiat/panda">FiatPanda</a>
    <a href="/fiat/500">500</a>
    <a href="/fiat/tipo">FiatTipo</a>
    <a href="/fiat/contact">Contact Us</a>
</header>
views/Fiat/index.mvc.php
New file
@@ -0,0 +1,11 @@
{% extends "base.mvc.php" %}
{% block title %} Home {% endblock %}
{% block body %}
{% include "../views/Fiat/header.mvc.php" %}
<h1>Scegli l'automobile piĆ¹ adatta a te!</h1>
{% include "../views/Fiat/footer.mvc.php" %}
{% endblock %}
views/Fiat/index.php