PHP Classes

File: src/helpers/helper_routes.php

Recommend this page to a friend!
  Classes of António Lira Fernandes   Web Service PHP MySQL   src/helpers/helper_routes.php   Download  
File: src/helpers/helper_routes.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Web Service PHP MySQL
Implement an API using MySQL to store objects
Author: By
Last change:
Date: 23 days ago
Size: 433 bytes
 

Contents

Class file image Download
<?php
use src\Route;
use
src\Request;

function
request(){
    return new
Request;
}


function
resolve($request = null){
    if(
is_null($request)) {
       
$request = request();
    }
    return
Route::resolve($request);
}


function
route($name, $params = null){
    return
Route::translate($name, $params);
}

function
redirect($pattern){
    return
resolve($pattern);
}

function
back(){
    return
header('Location: ' . $_SERVER['HTTP_REFERER']);
}

?>