Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php routing

<?php

$request = $_SERVER['REQUEST_URI'];

switch ($request) {
    case '/' :
        require __DIR__ . '/views/index.php';
        break;
    case '' :
        require __DIR__ . '/views/index.php';
        break;
    case '/about' :
        require __DIR__ . '/views/about.php';
        break;
    default:
        http_response_code(404);
        require __DIR__ . '/views/404.php';
        break;
}
Comment

routing with php

// plain php routing
https://phprouter.com/
Comment

PREVIOUS NEXT
Code Example
Php :: php variable definition 
Php :: PHP OOP - Constructor 
Php :: laravel get route action 
Php :: laravel collection union 
Php :: laravel collection splice 
Php :: php crud generator 
Php :: laravel "query()-find" 
Php :: How to insert header in php 
Php :: autoloading classes 
Php :: laravel best practices 
Php :: nested loop in php 
Php :: show date php by letters 
Php :: multiline string php 
Php :: The Laravel installer requires PHP 7.3.0 or greater. Please use "composer create-project laravel/laravel" instead. 
Php :: Call to undefined method IlluminateDatabaseEloquentRelationsHasMany::attach() 
Php :: php vs python speed 
Php :: What is the purpose of an abstract? 
Php :: php array if 
Php :: php glue strings 
Php :: laravel backpack 
Php :: laravel create command tutorial 
Php :: php ascii to decimal 
Php :: wordpress add action 
Php :: laravel + join 2 eloquent queries 
Php :: how to fetch data from database in php 
Php :: php javascript dynamic form 
Php :: search line phpstorm mac 
Php :: PHP Dependency Resolver 
Php :: php auto reset score 
Php :: if order has product id in array 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =