Crafty_Block class implementation
Any crafty block will get it's own Crafty_Block instance with individual $content.
Each time the block is used static it will be cloned at compile time from Crafty_Compiler::$blocks and compiled itsself.
Located in /crafty/Crafty_Block.class.php (line 55)
Object handle of the Crafty_Compiler for this block.
Stores all data the block needs to compile
This is a list of object handles of Crafty_Core_* objects and corresponding datasets or other Crafty_Block instances.
Since this will be compiled recursively by compileElement() it can be a complex "tree" of arrays.
Filename where the block is defined
Defines if a blocks content is stored in an external file
Line number of the content begining in the definition file
Line number of the block declaration in the definition file
Stores the the name of the block or it's linearized adresses
The original parsed blocks will have it's name in here and the cloned ones for static compilation will have it's linearized adresses. For variable blocks that are compiled into separate files the blocks of Crafty_Compiler::$blocks will get a variable name/adress using $p.
The raw content of the block used for error tracing
The path to the template file that generated this block
Set by the constructor using Crafty_Compiler::template_path that is reset by recursion
Initializes a Crafty_Block instance
The constructor intializes a Crafty_Block instance and sets the $name aswell as the $compiler.
Compiles a block
This method will compile a block compiling all elements of the $content.
Recursively compile an Element
In case the Element is a Crafty_Block object this method will use its compile() method.
In case it is an array with a "core" index it writes the returned data of compileType() in the binary template file.
In case it is a different array it will recursively handle the elements.
Otherwise it assumes that the Element a string or something castable as string and writes it in the compiled templates. The last way however is not currently used.
Compiles a set of a core handler and a dataset
This method makes use of the Crafty_Core::compile().
Returns the linearized adress of the current block
This method makes use of the $name but strips of the "main." prefix.
If a suffix is set this will be conatenated to the adress path. Useful for getting the adress of a subelement of the current block.
Loads a raw blow of CraftyHTML
First this method replaces the preparse needles with the preparse replacements. Then it will try to match each core pattern. On success it will hand over the results to Crafty_Core::pregCallback().
All parts of the CraftyHTML that are not matched by any core will be handed to a Crafty_Core_String object.
Convert a $data entry to snippet that can be written in our compiled template.
If $add_quotes is TRUE the snippet can be used just like echo <snippet>;
If $add_quotes is FALSE the snippet can be used inside single quoted strings.
If $parse_array is true this will be done on all elements of the $param['array'] array and an array of snippets will be returned.
Documentation generated on Sat, 19 Feb 2005 01:43:39 +0100 by phpDocumentor 1.3.0RC3