2017 © Pedro Peláez
 

library lib-router

Router for handling web calls, allows dynamic registration at runtime

image

openlss/lib-router

Router for handling web calls, allows dynamic registration at runtime

  • Tuesday, April 9, 2013
  • by nullivex
  • Repository
  • 1 Watchers
  • 0 Stars
  • 116 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

openlss/lib-router

Router for handling web calls, allows dynamic registration at runtime, (*1)

Usage

use \LSS\Router;

Router::init();
Router::_get()->setRoot(ROOT);
Router::_get()->setDefault('/ctl/home.php');
Router::_get()->register('client','list'=>'/ctl/client_list.php');
$dest = Router::_get()->route(get('act'),get('do'),get('fire'));
require($dest);

Reference

(void) Router::init()

Calls the construct and starts the singleton, (*2)

(object) Router::_get()

Returns the current instance, (*3)

(string) Router::setDefault($dest)

Sets the default file to route too. Relative to root., (*4)

(string) Router::setRoot($root)

Set the root folder that all route calls are relative to., (*5)

(object) Router::register($act,$do=array())

  • $act The first routing argument
  • $do An array of secondary routing arguments
    • Do may also contain arrays of "fire" routing calls The router is tertiary

A more in depth example, (*6)

Router::_get()->register('client',array(
     'list'     =>  '/ctl/client_list.php'
    ,'edit'     =>  '/ctl/client_edit.php'
    ,'create'   =>  '/ctl/client_create.php'
    ,'manage'   =>  array( //this is a tiertiary segment
        'contacts'      =>  '/ctl/client_manage_contacts.php'i
         //set the default when the third segment is missing
        Router::DEF     =>  '/ctl/client_manage.php'    
    )
    //set the default when the second segment is missing
    ,Router::DEF    =>  '/ctl/client_list.php'
));

(string) Router::route($act=null,$do=null,$fire=nul)

  • $act The first routing segment usually a get variable
  • $do The second routing segement usually a get variable
  • $fire The thrist routing segment Returns the controller to route to which should then be sent to require()

The Versions

09/04 2013

dev-master

9999999-dev http://openlss.org

Router for handling web calls, allows dynamic registration at runtime

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

router call handling dynamic routing route defaults

09/04 2013

dev-0.0.x-dev

dev-0.0.x-dev http://openlss.org

Router for handling web calls, allows dynamic registration at runtime

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

router call handling dynamic routing route defaults

09/04 2013

0.0.8

0.0.8.0 http://openlss.org

Router for handling web calls, allows dynamic registration at runtime

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

router call handling dynamic routing route defaults

03/04 2013

0.0.3

0.0.3.0 http://openlss.org

Router for handling web calls, allows dynamic registration at runtime

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

router call handling dynamic routing route defaults

03/04 2013

0.0.4

0.0.4.0 http://openlss.org

Router for handling web calls, allows dynamic registration at runtime

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

router call handling dynamic routing route defaults

03/04 2013

0.0.5

0.0.5.0 http://openlss.org

Router for handling web calls, allows dynamic registration at runtime

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

router call handling dynamic routing route defaults

03/04 2013

0.0.6

0.0.6.0 http://openlss.org

Router for handling web calls, allows dynamic registration at runtime

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

router call handling dynamic routing route defaults

03/04 2013

0.0.7

0.0.7.0 http://openlss.org

Router for handling web calls, allows dynamic registration at runtime

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

router call handling dynamic routing route defaults

26/03 2013

0.0.2

0.0.2.0 http://openlss.org

Router for handling web calls, allows dynamic registration at runtime

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

router call handling dynamic routing route defaults

23/03 2013

0.0.1

0.0.1.0 http://openlss.org

Router for handling web calls, allows dynamic registration at runtime

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.2

 

router call handling dynamic routing route defaults