1 | <?php |
||
13 | class ExecHelper |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * @var AbstractViewComponent |
||
18 | */ |
||
19 | protected $component; |
||
20 | |||
21 | public function setComponent( AbstractViewComponent $component ) |
||
25 | |||
26 | /** |
||
27 | * Generate and return an appropriate URL or URI to call the exec handler identified by $execPath with $args |
||
28 | * @param string $execMethod Component hierarchy path to an exec handler function on a component |
||
29 | * @param array $args Arguments to be passed to the called handler |
||
30 | * @param bool $onlyComponentOutput |
||
31 | * @return string A URL or URI |
||
32 | */ |
||
33 | public function url( $execMethod, $args = [ ], $onlyComponentOutput = false ) // $onlyComponentOutput Not used in this implementation but necessary for subclasses |
||
40 | |||
41 | /** |
||
42 | * Generate and return a form, wrapping $formBody to call the exec handler identified by $execPath using the $method HTTP method |
||
43 | * @param string $execMethod Component hierarchy path to an exec handler function on a component |
||
44 | * @param string $method |
||
45 | * @param string $formBody The body of an HTML form to be wrapped |
||
46 | * @param bool $onlyComponentOutput |
||
47 | * @param null $formID |
||
48 | * @param null $onSubmit |
||
49 | * @param string $encType |
||
50 | * @return string HTML form |
||
51 | */ |
||
52 | public function wrapForm( |
||
76 | |||
77 | /** |
||
78 | * Helper for calling static methods |
||
79 | * @param $class |
||
80 | * @param $function |
||
81 | * @param array $args |
||
82 | * @return mixed|null |
||
83 | */ |
||
84 | function callStatic($class, $function, $args = array()) |
||
91 | |||
92 | /** |
||
93 | * Generate a link which replaces the content of a DOM element with the output of an exec method |
||
94 | * @param $execMethod |
||
95 | * @param array $args |
||
96 | * @param $targetDiv |
||
97 | * @param $linkText |
||
98 | * @param array $anchorAttrs |
||
99 | * @return string |
||
100 | */ |
||
101 | public function replaceElementUsingLink( $execMethod, $args = [ ], $targetDiv, $linkText, $anchorAttrs = [ ] ) |
||
130 | |||
131 | /** |
||
132 | * Generate a form which replaces the content of a DOM element with the output of an exec method |
||
133 | * @param $execMethod |
||
134 | * @param $method |
||
135 | * @param string $formBody The body of an HTML form to be wrapped |
||
136 | * @param $targetDiv |
||
137 | * @param $formID |
||
138 | * @param string $encType |
||
139 | * @return string |
||
140 | */ |
||
141 | public function replaceElementUsingForm( $execMethod, $method, $formBody, $targetDiv, $formID, $encType = 'application/x-www-form-urlencoded' ) |
||
166 | } |
||
167 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.