When I go to my site, it is supposed to redirect me to google.com
Here is my structure:
application
-config
-Application.php
-Router.php
public
-index.php
Here is my code:
index.php:
require '../application/config/Application.php';
$app = new Application();
Application.php:
<?php
require dirname(__DIR__).'config/Router.php';
class Application {
private $router = new Router();
public function __construct() {
$this->router;
}
}
?>
Router.php;
class Router {
public function __construct() {
header('Location: https://www.google.com');
}
}
I want it to redirect from index -> to Application.php -> to Router.php -> redirect to google.com in construct.
EDIT: I know it gets to Application.php because if I put the header
in the Application.php construct, it redirects. it's just not getting to the Router.php
Why am i doing all of this? because I want to test if everything is working first.