Table des matières

Routing

Description : Initilise the application, its environment's variables using configurations files (global and local).
Php : 5.3
Category : Routing
Package : Core
Author : Tavm@n <tavman@gmail.com>
License : http://creativecommons.org/licenses/by-nc/2.0/
Link : none
See : Action, All
Version : I-Radian v2.0.alpha 1
Since : 2010/01/27


Haut de page

reInit

Description : Resets page definition.
Signature : public static function reInit ()


Haut de page

definePage

Description : Find the couple site/action/methode/parametres of the page.
Signature : public static function definePage ()


Haut de page

getSitePath

Description : Site path accessor.
Signature : public static function getSitePath ($sSite)
Param : $sSite (String) : Site name
Return : String Site path link.
Usage :


<?php
function getTemplateContenant ()
{
    
$sSitePath Routing::getSitePath('my_site');
    [...]
}

Haut de page

getActionClassName

Description : Action class accessor.
Signature : public static function getActionClassName ($sAction)
Param : $sAction (String) : Action name.
Return : String Action (prefixed and suffixed).
Usage :


<?php
function getForm ()
{
    
$sActionName Routing::getActionClassName('my_action');
    
$aResults $sActionName::getResults();
}

Haut de page

getActionFile

Description : Action file link accessor.
Signature : public static function getActionFile ($sSite, $sAction)
Param : $sSite (String) : Site name
Return : String Action file link
Usage :


<?php
class AccueilAction extends Action
{
    public function 
doindex ($aParams=array())
    {
        echo 
Routing::getActionFile('my_site''my_action');
    }
}

Haut de page

getMethodName

Description : Methode name accessor.
Signature : public static function getMethodName ($sMethod)
Param : $sMethod (String) : Method name.
Return : String Method name (prefixed and suffixed)
Usage :


<?php
class AccueilAction extends Action
{
    public function 
doindex ($aParams=array())
    {
        if ( 
Routing::getMethodName('my_method') != __FUNCTION__ ) {
            echo 
'Une redirection a eu lieu.';
        }
    }
}

Haut de page

loadLinksParams

Description : Loads links parameters for all sites.
Signature : public static function loadLinksParams ()


Haut de page

getActualPage

Description : Actual page datas accessor.
Signature : public static function getActualPage ()
Return : Object Actual page datas.
Usage :


<?php
class AccueilAction extends Action
{
    public function 
doindex ($aParams=array())
    {
        echo
'<pre>';print_r(Routing::getActualPage());echo'</pre>';
    }
}

Haut de page

setActualPage

Description : Actual page setter.
Signature : public static function setActualPage ($oActualPage)
Param : $oActualPage (Object) : Actual page


Haut de page

getActualURL

Description : Current URL accessor.
Signature : public static function getActualURL ()
Return : Object Current URL.


Haut de page

routingFromJS

Description : Initializes routing rules from the links file.
Signature : public static function routingFromJS ($sFile)
Param : $sFile (String) : Rounting file link.
Note : See documentation for formating routing rules.


Haut de page

__construct

Description : [Constructor] Create a new link.
Signature : public function __construct ($sRoute, $sSite, $sAction, $sMethod, $aParams)
Param : $sRoute (String) : URL
Usage :


<?php
class AccueilAction extends Action
{
    public function 
doindex ($aParams=array())
    {
        new 
Routing(
            
'short_link/%s/%s',
            
'my_site',
            
'my_action',
            
'my_methode',
            array(
'param1''param2')
        );
    }
}

Haut de page

getRoute

Description : Route of the link accessor.
Signature : public function getRoute ()
Return : String Route of the link.


Haut de page

getSite

Description : Site of a link accessor.
Signature : public function getSite ()
Return : String Site.


Haut de page

getAction

Description : Action of a link accessor.
Signature : public function getAction ()
Return : String Action.


Haut de page

getMethod

Description : Method of a link accessor.
Signature : public function getMethod ()
Return : String Method.


Haut de page

getParams

Description : Parameters list of a link accessor.
Signature : public function getParams ()
Return : Array Parameters list.


Haut de page

run

Description : Call th emethod of a link.
Signature : public function run ($bIsRedirection=false)
Param : [$bIsRedirection=false] (Bool) : TRUE if it is a redirection, else FALSE.