pclib  2.3.2
Lightweight PHP framework
Public Member Functions | Data Fields
Router Class Reference

Translates URL to instance of Action class. More...

Inheritance diagram for Router:
BaseObject

Public Member Functions

 getAction ()
 Create Action from current request. More...
 
 createUrl ($s)
 Transform internal action (for example 'products/edit/id:1') to URL. More...
 
- Public Member Functions inherited from BaseObject
 loadDefaults ($className=null)
 Load default parameters of class $className into object instance.
 
 setProperties (array $defaults)
 Set public properties of object from the array. More...
 
 addEvent ($name, $callback)
 Add event handler to $object->$name property. More...
 
 toArray ()
 Convert object to array. More...
 

Data Fields

 $friendlyUrl = false
 Create friendly URL?
 
 $action
 var Action Current Action
 
 $onGetAction
 Occurs after Action is created from HTTP request and before dispatch. More...
 
 $onCreateUrl
 Occurs when url (link) is created from Action. More...
 
- Data Fields inherited from BaseObject
 $onNewInstance
 Occurs when new instance of the class is created. More...
 
 $onMissingMethod
 Occurs when called method does not exist. More...
 
 $serviceLocator
 var function() Return service object when requested with service(). More...
 

Additional Inherited Members

- Static Public Member Functions inherited from BaseObject
static defaults ()
 Set or retireve default parameters of the object. More...
 
- Protected Member Functions inherited from BaseObject
 fireEvent ($name, array $args=array())
 Run all event handlers in $object->$name property. More...
 
 service ($service, $default=null)
 Try acquire $service and load it into property $this->$service. More...
 

Detailed Description

Translates URL to instance of Action class.

Action contains class and method name (with parameters) which will be called.

Member Function Documentation

createUrl (   $s)

Transform internal action (for example 'products/edit/id:1') to URL.

Parameters
string | Action$s
Returns
string $url
getAction ( )

Create Action from current request.

Override for your own URL format.

Returns
Action $action

Field Documentation

$onCreateUrl

Occurs when url (link) is created from Action.

$onGetAction

Occurs after Action is created from HTTP request and before dispatch.


The documentation for this class was generated from the following file: