|
18 | 18 | * changing a wide array of details about how a
|
19 | 19 | * template gets parsed.
|
20 | 20 | */
|
21 |
| -class CustomViewHelperResolver extends ViewHelperResolver { |
| 21 | +class CustomViewHelperResolver extends ViewHelperResolver |
| 22 | +{ |
22 | 23 |
|
23 |
| - /** |
24 |
| - * Returns the built-in set of ViewHelper classes with |
25 |
| - * one addition, `f:myLink` which is redirected to anoter |
26 |
| - * class. |
27 |
| - * |
28 |
| - * @param string $namespaceIdentifier |
29 |
| - * @param string $methodIdentifier |
30 |
| - * @return string |
31 |
| - */ |
32 |
| - public function resolveViewHelperClassName($namespaceIdentifier, $methodIdentifier) { |
33 |
| - if ($namespaceIdentifier === 'f' && $methodIdentifier === 'myLink') { |
34 |
| - return 'TYPO3Fluid\\FluidExample\\ViewHelpers\\CustomViewHelper'; |
35 |
| - } |
36 |
| - return parent::resolveViewHelperClassName($namespaceIdentifier, $methodIdentifier); |
37 |
| - } |
38 |
| - |
39 |
| - /** |
40 |
| - * Asks the ViewHelper for argument definitions and adds |
41 |
| - * a case which matches our custom ViewHelper in order to |
42 |
| - * manipulate its argument definitions. |
43 |
| - * |
44 |
| - * @param ViewHelperInterface $viewHelper |
45 |
| - * @return ArgumentDefinition[] |
46 |
| - */ |
47 |
| - public function getArgumentDefinitionsForViewHelper(ViewHelperInterface $viewHelper) { |
48 |
| - $arguments = parent::getArgumentDefinitionsForViewHelper($viewHelper); |
49 |
| - if ($viewHelper instanceof CustomViewHelper) { |
50 |
| - $arguments['page'] = new ArgumentDefinition( |
51 |
| - 'page', |
52 |
| - 'array', // our argument must now be an array |
53 |
| - 'This is our new description for the argument', |
54 |
| - FALSE, // argument is no longer mandatory |
55 |
| - ['foo' => 'bar'] // our argument has a new default value if argument is not provided |
56 |
| - ); |
57 |
| - } |
58 |
| - return $arguments; |
59 |
| - } |
| 24 | + /** |
| 25 | + * Returns the built-in set of ViewHelper classes with |
| 26 | + * one addition, `f:myLink` which is redirected to anoter |
| 27 | + * class. |
| 28 | + * |
| 29 | + * @param string $namespaceIdentifier |
| 30 | + * @param string $methodIdentifier |
| 31 | + * @return string |
| 32 | + */ |
| 33 | + public function resolveViewHelperClassName($namespaceIdentifier, $methodIdentifier) |
| 34 | + { |
| 35 | + if ($namespaceIdentifier === 'f' && $methodIdentifier === 'myLink') { |
| 36 | + return 'TYPO3Fluid\\FluidExample\\ViewHelpers\\CustomViewHelper'; |
| 37 | + } |
| 38 | + return parent::resolveViewHelperClassName($namespaceIdentifier, $methodIdentifier); |
| 39 | + } |
60 | 40 |
|
| 41 | + /** |
| 42 | + * Asks the ViewHelper for argument definitions and adds |
| 43 | + * a case which matches our custom ViewHelper in order to |
| 44 | + * manipulate its argument definitions. |
| 45 | + * |
| 46 | + * @param ViewHelperInterface $viewHelper |
| 47 | + * @return ArgumentDefinition[] |
| 48 | + */ |
| 49 | + public function getArgumentDefinitionsForViewHelper(ViewHelperInterface $viewHelper) |
| 50 | + { |
| 51 | + $arguments = parent::getArgumentDefinitionsForViewHelper($viewHelper); |
| 52 | + if ($viewHelper instanceof CustomViewHelper) { |
| 53 | + $arguments['page'] = new ArgumentDefinition( |
| 54 | + 'page', |
| 55 | + 'array', // our argument must now be an array |
| 56 | + 'This is our new description for the argument', |
| 57 | + false, // argument is no longer mandatory |
| 58 | + ['foo' => 'bar'] // our argument has a new default value if argument is not provided |
| 59 | + ); |
| 60 | + } |
| 61 | + return $arguments; |
| 62 | + } |
61 | 63 | }
|
0 commit comments