Smalldb  v0.0-177-g1a83180
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | Protected Attributes | List of all members
RouterFactoryBlock Class Reference

/ More...

Inheritance diagram for RouterFactoryBlock:
Inheritance graph

Public Member Functions

 main ()
 Block body.
 
 postprocessor ($route)
 Route postprocessor to be registered in router. More...
 
- Public Member Functions inherited from BackendBlock
 __construct ($smalldb)
 Setup block to act as expected. More...
 

Public Attributes

const force_exec = true
 Block must be always executed.
 

Protected Attributes

 $inputs
 Block inputs. More...
 
 $outputs
 Block inputs. More...
 
- Protected Attributes inherited from BackendBlock
 $smalldb
 Smalldb backend obtained from block storage.
 

Detailed Description

/

Todo:
DOC! Raw and ugly connector to access Smalldb interface from outter world.

Deprecated! This connector will be replaced with something better soon.

This connector also directly reads $_GET and $_POST, which is also ugly. And to make it even worse, it produces output!

If route is matched, inputs are copied to route and processed using filename_format funciton. Matched route and following data are available as variables:

Note
If input is set to "{smalldb_ref}", then it is set to Smalldb::StateMachine::Reference object instead of string.
Example
If input "block" is set to "{smalldb_type}/{smalldb_action_or_show}", then output 'block' will be usable as input for block_loader.

Member Function Documentation

postprocessor (   $route)

Route postprocessor to be registered in router.

Route will call this method to check whether a Smalldb route is valid reference to some statemachine. If valid reference is found, the reference is published at router's output.

Postprocessor uses '!' to denote action. Action is part of path after the last '!'. Action never contains slash and it must be at the end of the path.

Member Data Documentation

$inputs
protected
Initial value:
= array(
'*' => null,
)

Block inputs.

$outputs
protected
Initial value:
= array(
'postproc' => true,
'done' => true,
)

Block inputs.