diff options
author | Kevin Chabowski <kevin@kch42.de> | 2015-04-14 22:24:34 +0200 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2015-04-14 22:24:34 +0200 |
commit | 31241a2ab9c97e09ddbd4fb9e41b4e2e756d8ed4 (patch) | |
tree | 3cb0d5d7434f634826981ad30a08d2ff0f9298e3 | |
parent | 17f662cc6ff4f50c30270a23f6679af1b251e82c (diff) | |
download | ste-31241a2ab9c97e09ddbd4fb9e41b4e2e756d8ed4.tar.gz ste-31241a2ab9c97e09ddbd4fb9e41b4e2e756d8ed4.tar.bz2 ste-31241a2ab9c97e09ddbd4fb9e41b4e2e756d8ed4.zip |
Some autoescaping documentationautoescape
-rw-r--r-- | src/ste/STECore.php | 16 |
1 files changed, 16 insertions, 0 deletions
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; |