Open adeilsonaalima opened 1 year ago
Sorry for my english... anyway:
This is my controller:
<?php namespace src\controllers; use League\Plates\Engine; use League\Plates\Extension\Asset; class Web { private $templates; public function __construct() { $this->templates = new Engine(__DIR__ . "/../views", "php"); $this->templates->loadExtension(new Asset(__DIR__ . '/../assets/', false)); // or true } public function home(): void { echo $this->templates->render("register-and-login/home", [ "title" => "Home | " . SITE, "users" => ["Adeilson", "Karol"] ]); } }
And this is in my template:
<link rel="stylesheet" href="<?= $this->asset('/css/style.css') ?>">
If I change to a non-existent path it gives an error 500, but if it is correct it defines the following path when rendering:
<link rel="stylesheet" href="/css/style.css?v=1687988335">
And this error:
GET https://mysite.com.br/css/style.css?v=1687988335 net::ERR_ABORTED 404 (Not Found)
Why? Someone can help me?
Sorry for my english... anyway:
This is my controller:
And this is in my template:
<link rel="stylesheet" href="<?= $this->asset('/css/style.css') ?>">
If I change to a non-existent path it gives an error 500, but if it is correct it defines the following path when rendering:
<link rel="stylesheet" href="/css/style.css?v=1687988335">
And this error:
GET https://mysite.com.br/css/style.css?v=1687988335 net::ERR_ABORTED 404 (Not Found)
Why? Someone can help me?