public function e($text, $context = null, $echo = null) { if ($context === null) { $context = $this->defaultEscapingContext; } if ($echo === null) { $echo = $this->defaultEcho; } if ($context == 'html') { $text = StringTools::escapeHtml($text); } else { if ($context == 'js') { $text = StringTools::escapeJs($text); } else { if ($context == 'url') { $text = urlencode($text); } } } if ($echo) { echo $text; return null; } else { return $text; } }