From e546bbaf6bbee16356beb675cc3e806d9793688e Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 10 May 2021 16:29:16 +0200 Subject: lib: implement render(), an include variant capturing output in a string Signed-off-by: Jo-Philipp Wich --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 549459e..83bfc07 100644 --- a/README.md +++ b/README.md @@ -998,7 +998,7 @@ json('{"a":true, "b":123}') // { "a": true, "b": 123 } json('[1,2,') // Throws exception ``` -#### 6.50. `include(path, scope)` +#### 6.50. `include(path[, scope])` Evaluate and include the file at the given path and optionally override the execution scope with the given scope object. @@ -1113,3 +1113,9 @@ an invalid value was passed, otherwise `true`. Raise an exception with the given `message` parameter if the value in `cond` is not truish. When `message` is omitted, the default value is `Assertion failed`. + +#### 6.57. `render(path[, scope])` + +Like `include()` but capture output of included file as string and return it. + +See `include()` for details on scoping. -- cgit v1.2.3