From 31241a2ab9c97e09ddbd4fb9e41b4e2e756d8ed4 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Tue, 14 Apr 2015 22:24:34 +0200 Subject: Some autoescaping documentation --- src/ste/STECore.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/ste/STECore.php b/src/ste/STECore.php index 91a96ca..b021e3b 100644 --- a/src/ste/STECore.php +++ b/src/ste/STECore.php @@ -10,6 +10,12 @@ namespace kch42\ste; * The Core of STE */ class STECore { + /* + * Constants: Modes for autoescaping. + * + * ESCAPE_NONE - Don't escape + * MODE_TRANSCOMPILED - Escape as HTML + */ const ESCAPE_NONE = "none"; const ESCAPE_HTML = "html"; @@ -115,6 +121,16 @@ class STECore { return $content; } + /* + * Evaluate a $sub function (representing the contents of a tag) with a different escaping method for autoescape. + * + * Parameters: + * $sub - Callback representing the contents of a tag. + * $method - One of the ESCAPE_* constants. + * + * Returns: + * The evaluated content. + */ public function eval_sub_with_escaping($sub, $method) { $old_method = $this->escape_method; $this->escape_method = $method; -- cgit v1.2.3-54-g00ecf