Quick
class Quick
Methods
Generate the Quick renderer's source
Export an array as PHP
Compute the rendering strategy for a compiled template
Generate the code for rendering a compiled template with the Quick renderer
Convert the two sides of a compiled template to quick rendering
Replace the PHP code used in a compiled template to be used by the Quick renderer
Build the source for the two sides of a templates based on the structure extracted from its original source
Get the unique values for the "passthrough" key of given branches
Get a string suitable as a preg_replace() replacement for given PHP code
Get a string suitable as a str_replace() replacement for given PHP code
Get string rendering strategies for given chunks
Replace all instances of a uniqid with a PCRE replacement in a string
Details
at line 22
static string
getSource(array $compiledTemplates)
Generate the Quick renderer's source
at line 104
static protected string
export(array $arr)
Export an array as PHP
at line 125
static array[]
getRenderingStrategy(string $php)
Compute the rendering strategy for a compiled template
at line 159
static protected string[]
getQuickRendering(string $php)
Generate the code for rendering a compiled template with the Quick renderer
Parse and record every code path that contains a passthrough. Parse every if-else structure. When the whole structure is parsed, there are 2 possible situations:
- no code path contains a passthrough, in which case we discard the data
- all the code paths including the mandatory "else" branch contain a passthrough, in which case we keep the data
at line 341
static protected void
convertPHP(string $head, string $tail, bool $passthrough)
Convert the two sides of a compiled template to quick rendering
at line 394
static protected void
replacePHP(string $php)
Replace the PHP code used in a compiled template to be used by the Quick renderer
at line 503
static protected string[]
buildPHP(array $branches)
Build the source for the two sides of a templates based on the structure extracted from its original source
at line 532
static protected int[]
getBranchesPassthrough(array $branches)
Get the unique values for the "passthrough" key of given branches
at line 556
static protected array|bool
getDynamicRendering(string $php)
Get a string suitable as a preg_replace() replacement for given PHP code
at line 693
static protected bool|string
getStaticRendering(string $php)
Get a string suitable as a str_replace() replacement for given PHP code
at line 715
static protected array
getStringRenderings(string $php)
Get string rendering strategies for given chunks
at line 756
static protected void
replacePlaceholder(string $str, string $uniqid, int $index)
Replace all instances of a uniqid with a PCRE replacement in a string