Get a working render function by a string of PHP code. This method may requires php setting allow_url_include=1 and allow_url_fopen=1 , or access right to tmp file system.
public static prepare ( string $php, string | null $tmpDir = null, boolean $delete = true ) : Closure | false | ||
$php | string | PHP code |
$tmpDir | string | null | Optional, change temp directory for php include file saved by prepare() when cannot include PHP code with data:// format. |
$delete | boolean | Optional, delete temp php file when set to tru. Default is true, set it to false for debug propose |
return | Closure | false | result of include() |