PHP Classes

File: src/helpers/helper_routes.php

Recommend this page to a friend!
  Classes of António Lira Fernandes   Web Service PHP JSON   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 JSON
API example that stores information in JSON files
Author: By
Last change:
Date: 20 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']);
}

?>