Skip to content

Commit 559847b

Browse files
committed
Remove option to customize render function
1 parent 9b57ea6 commit 559847b

File tree

3 files changed

+0
-25
lines changed

3 files changed

+0
-25
lines changed

README.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -282,29 +282,6 @@ Here are the list of LightnCandy\Runtime debug options for render function:
282282
* `DEBUG_TAGS_ANSI` : turn the return value of render function into normalized mustache tags with ANSI color
283283
* `DEBUG_TAGS_HTML` : turn the return value of render function into normalized mustache tags with HTML comments
284284

285-
Customize Render Function
286-
-------------------------
287-
288-
If you want to do extra tasks inside render function or add more comment, you may use `renderex` when `compile()` . For example, this sample embed the compile time comment into the template:
289-
290-
```php
291-
$php = LightnCandy::compile($template, array(
292-
'renderex' => '// Compiled at ' . date('Y-m-d h:i:s')
293-
));
294-
```
295-
296-
Your render function will be:
297-
298-
```php
299-
function ($in) {
300-
$cx = array(...);
301-
// compiled at 1999-12-31 00:00:00
302-
return .....
303-
}
304-
```
305-
306-
Please make sure the passed in `renderex` is valid PHP, LightnCandy will not check it.
307-
308285
Unsupported Feature
309286
-------------------
310287

src/Compiler.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ public static function composePHPRender($context, $code)
107107
'blparam' => array(),
108108
'partialid' => 0,
109109
);
110-
{$context['renderex']}
111110
{$context['ops']['array_check']}
112111
{$context['ops']['op_start']}'$code'{$context['ops']['op_end']}
113112
};

src/Context.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ public static function create($options)
102102
'partialblock' => array(),
103103
'inlinepartial' => array(),
104104
'helpers' => array(),
105-
'renderex' => isset($options['renderex']) ? $options['renderex'] : '',
106105
'safestring' => '\\LightnCandy\\SafeString',
107106
'safestringalias' => isset($options['safestring']) ? $options['safestring'] : 'LS',
108107
'rawblock' => false,

0 commit comments

Comments
 (0)