Crafty_Core abstract class
The Crafty_Core class is a parent class for all Crafty_Core_* classes. It features helpful preg tools for parameter parsing etc., so the extending class cann concentrate on the individual important things. If you just want to write templates you will never need to care about this class. It's children are only used by the compiler.
Located in /crafty/core/Crafty_Core.class.php (line 56)
| Class | Description |
|---|---|
| Crafty_Core_Block | Crafty_Core_Block class implementation |
| Crafty_Core_Blocklist | Crafty_Core_Blocklist class implementation |
| Crafty_Core_Comment | Crafty_Core_Comment class implementation |
| Crafty_Core_Formelement | Crafty_Core_Formelement class implementation |
| Crafty_Core_Link | Crafty_Core_Link class implementation |
| Crafty_Core_Now | Crafty_Core_Now class implementation |
| Crafty_Core_String | Crafty_Core_String class implementation |
| Crafty_Core_Variable | Crafty_Core_Variable class implementation |
| Crafty_Core_Define | Crafty_Core_Define class implementation |
| Crafty_Core_Require | Crafty_Core_Require class implementation |
The name of this Crafty_Core_<name>
This one is hardly used (except for error messages) and automatically generated by the constructor.
Compiler object handle
Object handle of the Crafty_Compiler that spawned this core. This one is especially helpful to get the config.
Configuration object handle
The object handle of the Core specific xml configuration part. The constructor gets this one from the compiler.
Preg pattern to capture the used cores
_setPattern() helps to create this preg.
Abstract constructor
By calling this abstract parent constructor a Crafty_Core_* child gets the $compiler and $_config set correctly.
Compile this core to binary code
Any Crafty_Core_* class must have an own compile function. This function will get a complex $data array and a Crafty_Block.
Using that intput it will return a string containing php code that will be written in the compiled temmplate file.
Returns the current Crafty_Core::$_pattern
If the pattern is empty FALSE will be returned and the core will not capture with preg_match_all.
Parses parameters of a core
This method takes a preg result set ($matches) and parses it for parameters using once again very complex perl regular expressions.
It also replaces the preparser replacements with their final values.
It also takes care of security and prepares for usage in single quoted strings.
Finally it replaces the configuration variables using _defineCheck().
Generates a random variable name
Such a random variable name will be used for temporary variables in the (binary) php code. If $adddollar is TRUE the dollar for php variables will be added, otherwise it will be left as a random string.
Helper function for pregCallback()
Checks if the parameter $data contains defined variables and replaces them if that is the case.
Returns an array to save in Crafty_Block::$content
This method is called by pregCallback() and will return an array of the parameter $data and the object handle of the core itsself.
Construct a preg pattern
If the configuration part for the core is complete this method can be called without any arguments. You should only use the parameters if you know what you are doing.
Documentation generated on Sat, 19 Feb 2005 01:43:42 +0100 by phpDocumentor 1.3.0RC3