pclib  2.3.2
Lightweight PHP framework
Static Public Member Functions
TemplateFactory Class Reference

Template factory. More...

Inheritance diagram for TemplateFactory:
BaseObject

Static Public Member Functions

static create ($path, array $columns)
 Create template object from database columns. More...
 
static getTemplate ($path, array $columns)
 Create template from database columns. More...
 
- Static Public Member Functions inherited from BaseObject
static defaults ()
 Set or retireve default parameters of the object. More...
 

Additional Inherited Members

- 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 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...
 
- 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

Template factory.

Build grid, form or tpl from list of database columns. Usage: $grid = TemplateFactory::create('grid.tpl', $columns);

Member Function Documentation

static create (   $path,
array  $columns 
)
static

Create template object from database columns.

Parameters
string$pathPath to generator template (see assets/tpl for defaults)
array$columnsList of database columns (see Db->columns() method)
Returns
Tpl|Form|Grid $object
static getTemplate (   $path,
array  $columns 
)
static

Create template from database columns.

Parameters
string$pathPath to generator template (see assets/tpl for defaults)
array$columnsList of database columns (see Db->columns() method)
Returns
string $template Template source

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