PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Maniruzzaman Akash   Simple, Fast, Lightweight PHP MVC Framework   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Simple, Fast, Lightweight PHP MVC Framework
Route requests to controller classes or closures
Author: By
Last change:
Date: 8 months ago
Size: 692 bytes


Class file image Download

use Pecee\SimpleRouter\SimpleRouter;

// Autoload the vendor
require_once __DIR__ . '/vendor/autoload.php';

// Load from environment variables.
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);

define('ROOT', __DIR__);
define('VIEWS', __DIR__ . '/views');
define('ASSET_DIR', __DIR__ . '/assets');
define('BASE_DIR', isset($_ENV['BASE_DIR']) ? $_ENV['BASE_DIR'] : '');
define('URL', $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . '/' . BASE_DIR);
define('ASSET_URL', URL . '/assets');

/* Load external routes file */
require_once 'routes/route.php';

// Start the routing