pclib
3.0.0
Lightweight PHP framework
|
You can override default element print/validate handler for any element (tag) in template. PClib supports two events when your handlers can be called:
You must set your handler in elements section of the template, like this:
or
for validation.
Next, you must define your handler in php source code. Note that handler can be any php callable.
function printName($sender, $id, $sub, $value) {...}
With print handler you can modify result printed into template, or perform some additional actions. Example:
Since php 5.3.0 you can use even anonymous functions as handler:
$form->_NAME->onprint = function($sender, $id, $sub, $value) {...}