PHP Classes

PHP Router Library JS: Get HTTP request route based on a hash parameter

Recommend this page to a friend!

  Author Author  
Picture of Sergey Kol'miller
Name: Sergey Kol'miller <contact>
Classes: 5 packages by
Country: Russian Federation Russian Federation
Age: 38
All time rank: 357298 in Russian Federation Russian Federation
Week rank: 24 Up3 in Russian Federation Russian Federation Up
Innovation award
Innovation award
Nominee: 3x


  Detailed description   Download Download .zip .tar.gz   Install with Composer Install with Composer  
This package can get an HTTP request route based on a hash parameter.

It checks a hash parameter value sent via HTTP post and parses and YAML file with route configuration to extract the route definitions associated with the hash value.

The package returns a JSON structure with the definition of the hash routes.

Details

PHP and JavaScript route for hash module.

"require": {

    "symfony/yaml": "^4.0"
}  

"dependencies": {

"ajaxsim": "^1.0.0"

}

_Installation_

php: $~ composer require kolserdav/routejs

js: $~ npm i route-fhash

_Route settings_

file name: /config/route/routes.yaml

#Example routes.yaml
nameroutegroup1 :	#Require field custom name
      hash: #Require field and name
        nameroute1 : filename1::module1 #Custom fields with special format
        nameroure2 : filename2::module2
nameroutegroup2 :
      hash :
        nameroute3 : filename3::module3
        nameroute4 : filename4::module4
        nameroute4 : filename4::module5

_Using php_

script uri: /routejs-data

require_once '../vendor/autoload.php';
use Avir\Hash\Reader;
$s = new Reader();
$s->getRoutes();

_Using javascript_

let route = require('route-fhash');
route('dir/with/route/files');

  Classes of Sergey Kol'miller  >  PHP Router Library JS  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog (1)  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: PHP Router Library JS
Base name: routejs
Description: Get HTTP request route based on a hash parameter
Version: 1.0.0
PHP version: 5
License: MIT/X Consortium License
All time users: 91 users
All time rank: 9742
Week users: 0 users
Week rank: 310 Equal
 
  Groups   Rate classes User ratings   Applications   Files Files  

  Groups  
Group folder image HTTP HTTP protocol clients, headers and cookies View top rated classes
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes


  Innovation Award  
PHP Programming Innovation award nominee
February 2022
Number 10
Many Web applications can process browser-side requests using JavaScript using responses retrieved from the server-side. PHP code can handle those server-side requests.

This package can process client-side requests to retrieve HTTP route information from the server-side according to a parameter that is the value after the hash (#) character.

This possibility allows configuring Web application routes for applications implemented on the client-side in JavaScript using PHP code's configuration values defined on the server-side.

Manuel Lemos

  User ratings  
Not yet rated by the users

  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Files folder imagesrc (1 file, 1 directory)
Plain text file composer.json Data Auxiliary data
Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imageMain (1 file)
  Plain text file Reader.php Class Class source

  Files folder image Files  /  src  /  Main  
File Role Description
  Plain text file Factory.php Class Class source

Install with Composer Install with Composer - Download Download all files: routejs.tar.gz routejs.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
For more information send a message to info at phpclasses dot org.