2017 © Pedro Peláez
 

library php-library-fastest

PHP Library Fastest

image

sinevia/php-library-fastest

PHP Library Fastest

  • Sunday, July 29, 2018
  • by sinevia
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

PHP Library Fastest

Fastest router, (*1)

How it works

Simple and unassuming router., (*2)

  1. The router checks for an action parameter in the URL. If not found assumes "home".
index.php?a=home (this is default)
index.php?a=register

  1. Executes a PHP function for the requested action., (*3)

  2. The action function has the same name as the requested action with the "_action" postfix., (*4)

(action: home => function: home_action)
(action: register => function: register_action)
  1. Dashes, spaces, and forward slashes are replaced with underscores
(action: auth/login => function: auth_login_action)
(action: auth-login => function: auth_login_action)

Installation

  1. Using composer (recommended)
composer require sinevia/php-library-fastest
  1. Manually. Copy the fastest.php file and use the include_once function to include

Usage

  1. Add the following line to where the router will be working. It can be the main router of the app, or a standalone PHP webpage.
// Add the actions
require_once('../actions/home_action.php');
require_once('../actions/login_action.php');

// Execute the router
\Sinevia::fastest();
  • Optionally the action can be set manually, for instance to have nice URLs
// Manually set the action and execute
$uri = strtok($_SERVER["REQUEST_URI"],'?');
$result = \Sinevia::fastest(['action' => $uri]);
  • Optionally the result can be output as string to be processed manually further
// Get the result as string and output
$result = \Sinevia::fastest(['output_as_string' => true]);
die($result);
  1. Example functions
/**
 * The home function
 * route: ?a= or /
 */
function home_action {
    return 'Home';
}

/**
 * The login function
 * route: ?a=login or /login
 */
function login_action {
    return 'Login';
}

The Versions

29/07 2018

dev-master

9999999-dev http://github.com/sinevia/php-library-fastest

PHP Library Fastest

  Sources   Download

proprietary

php library sinevia fastest

29/07 2018

v2.0.0

2.0.0.0 http://github.com/sinevia/php-library-fastest

PHP Library Fastest

  Sources   Download

proprietary

php library sinevia fastest

06/01 2018

v1.0.0

1.0.0.0 http://github.com/sinevia/php-library-fastest

PHP Library Fastest

  Sources   Download

commercial

php library sinevia fastest