![]() |
![]()
| ![]() |
![]()
renderThis wraps around the process method of the original Template class. It expects the parameter string as first argument (scalar, not reference!) and a hashref with the params for template. The class tries to auto-deserialize parameters from the params array by evaluating the template string for sequences like context.upper.lower (this is yet done for the context prefix only). The result is returned as a string, if processing fails, an OpenXPKI::Exception is thrown. render_from_fileExpects a filename instead of a template string as first argument and uses the content of this file as template string. The second parameter is passed unmodified to render as template arguments. Return undef if the file can not be read or is empty. render_from_shortcutExpects the template to be a shortcut pattern, starting with the dollar sign followed by the key name and an optional subkey, separated by a dot. Allowed charaters are word characters and the dash. To support lean shortcuts from e.g. the context, the second argument can be a subroutine reference that returns the value for a given key instead of a hash ref. Will die if the given template is not a shortcut. Will return non-scalar values if the requested key is not a scalar! Examples
|