ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
TokenFactory.php
Go to the documentation of this file.
1<?php
2
15{
16 // p stands for prototype
17
21 private $p_start;
22
26 private $p_end;
27
31 private $p_empty;
32
36 private $p_text;
37
41 private $p_comment;
42
46 public function __construct()
47 {
48 $this->p_start = new HTMLPurifier_Token_Start('', array());
49 $this->p_end = new HTMLPurifier_Token_End('');
50 $this->p_empty = new HTMLPurifier_Token_Empty('', array());
51 $this->p_text = new HTMLPurifier_Token_Text('');
52 $this->p_comment = new HTMLPurifier_Token_Comment('');
53 }
54
61 public function createStart($name, $attr = array())
62 {
63 $p = clone $this->p_start;
64 $p->__construct($name, $attr);
65 return $p;
66 }
67
73 public function createEnd($name)
74 {
75 $p = clone $this->p_end;
76 $p->__construct($name);
77 return $p;
78 }
79
86 public function createEmpty($name, $attr = array())
87 {
88 $p = clone $this->p_empty;
89 $p->__construct($name, $attr);
90 return $p;
91 }
92
98 public function createText($data)
99 {
100 $p = clone $this->p_text;
101 $p->__construct($data);
102 return $p;
103 }
104
110 public function createComment($data)
111 {
112 $p = clone $this->p_comment;
113 $p->__construct($data);
114 return $p;
115 }
116}
117
118// vim: et sw=4 sts=4
Factory for token generation.
$p_start
@type HTMLPurifier_Token_Start
createEmpty($name, $attr=array())
Creates a HTMLPurifier_Token_Empty.
createEnd($name)
Creates a HTMLPurifier_Token_End.
$p_text
@type HTMLPurifier_Token_Text
$p_empty
@type HTMLPurifier_Token_Empty
__construct()
Generates blank prototypes for cloning.
$p_end
@type HTMLPurifier_Token_End
$p_comment
@type HTMLPurifier_Token_Comment
createComment($data)
Creates a HTMLPurifier_Token_Comment.
createText($data)
Creates a HTMLPurifier_Token_Text.
createStart($name, $attr=array())
Creates a HTMLPurifier_Token_Start.
Concrete comment token class.
Definition: Comment.php:7
Concrete empty token class.
Definition: Empty.php:7
Concrete end token class.
Definition: End.php:11
Concrete start token class.
Definition: Start.php:7
Concrete text token class.
Definition: Text.php:13
$data