1 | <?php |
||
18 | use Romm\Formz\Service\ViewHelper\Form\FormViewHelperService; |
||
19 | use TYPO3\CMS\Extbase\Mvc\Web\Request; |
||
20 | use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper; |
||
21 | |||
22 | class PreviousLinkViewHelper extends AbstractTagBasedViewHelper |
||
23 | { |
||
24 | const PREVIOUS_LINK_PARAMETER = 'fz-previous-step'; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $tagName = 'a'; |
||
30 | |||
31 | /** |
||
32 | * @var FormViewHelperService |
||
33 | */ |
||
34 | protected $formService; |
||
35 | |||
36 | public function initializeArguments() |
||
41 | |||
42 | public function render() |
||
43 | { |
||
44 | /* |
||
45 | * First, we check if this view helper is called from within the |
||
46 | * `FormViewHelper`, because it would not make sense anywhere else. |
||
47 | */ |
||
48 | if (false === $this->formService->formContextExists()) { |
||
49 | // @todo |
||
50 | // throw ContextNotFoundException::substepViewHelperFormContextNotFound(); |
||
51 | } |
||
52 | |||
53 | $formObject = $this->formService->getFormObject(); |
||
54 | $formDefinition = $formObject->getDefinition(); |
||
55 | |||
56 | if (false === $formDefinition->hasSteps()) { |
||
95 |