pclib  2.3.2
Lightweight PHP framework
Public Member Functions
TplParser Class Reference

Parse pclib template with pclib-elements code. More...

Inheritance diagram for TplParser:
BaseObject

Public Member Functions

 parse ($templateStr)
 Parse template. More...
 
 parseLine ($line)
 Parse element definition line and return $element array. 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from BaseObject
static defaults ()
 Set or retireve default parameters of the object. 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

Parse pclib template with pclib-elements code.

Example: $parsed = $parser->parse($templateStr);

Member Function Documentation

parse (   $templateStr)

Parse template.

Parameters
string$templateStrTemplate source code
Returns
array $parsed [$elements, $body]
parseLine (   $line)

Parse element definition line and return $element array.

Parameters
string$linepclib-element line - example: "input EMAIL required"
Returns
array $element

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