1: <?php
2:
3: namespace PHPixie\Template\Extensions\Extension;
4:
5: class HTML implements \PHPixie\Template\Extensions\Extension
6: {
7: public function name()
8: {
9: return 'html';
10: }
11:
12: public function methods()
13: {
14: return array(
15: 'htmlEscape' => 'escape',
16: 'htmlOutput' => 'output'
17: );
18: }
19:
20: public function aliases()
21: {
22: return array(
23: '_' => 'escape'
24: );
25: }
26:
27: public function escape($string)
28: {
29: return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
30: }
31:
32: public function output($string)
33: {
34: echo $this->escape($string);
35: }
36: }