[BUGFIX] Wording 78169-IntroduceTranslationSourceFieldForTt_content.rst
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Classes / Core / ViewHelper / ArgumentDefinition.php
1 <?php
2 namespace TYPO3\CMS\Fluid\Core\ViewHelper;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Argument definition of each view helper argument
19 *
20 * This subclass of ArgumentDefinition from Fluid has
21 * one additional capability: defining that an argument
22 * should be expected as a parameter for the render()
23 * method - which means the ViewHelperInvoker will be
24 * processing it a bit differently. Other than this it
25 * is a normal Fluid ArgumentDefinition.
26 */
27 class ArgumentDefinition extends \TYPO3Fluid\Fluid\Core\ViewHelper\ArgumentDefinition
28 {
29 /**
30 * TRUE if it is a method parameter
31 *
32 * @var bool
33 */
34 protected $isMethodParameter = false;
35
36 /**
37 * Constructor for this argument definition.
38 *
39 * @param string $name Name of argument
40 * @param string $type Type of argument
41 * @param string $description Description of argument
42 * @param bool $required TRUE if argument is required
43 * @param mixed $defaultValue Default value
44 * @param bool $isMethodParameter TRUE if this argument is a method parameter
45 */
46 public function __construct($name, $type, $description, $required, $defaultValue = null, $isMethodParameter = false)
47 {
48 $this->name = $name;
49 $this->type = $type;
50 $this->description = $description;
51 $this->required = $required;
52 $this->defaultValue = $defaultValue;
53 $this->isMethodParameter = $isMethodParameter;
54 }
55
56 /**
57 * TRUE if it is a method parameter
58 *
59 * @return bool TRUE if it's a method parameter
60 */
61 public function isMethodParameter()
62 {
63 return $this->isMethodParameter;
64 }
65 }