Skip to content

Commit 634aeef

Browse files
committed
[TASK] Add example of passing arguments to PageController
1 parent 222f7f6 commit 634aeef

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Classes/Controller/PageController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
class PageController extends \FluidTYPO3\Flux\Controller\PageController
88
{
99
/**
10+
* @param string $value
1011
* @return void
1112
*/
12-
public function standardAction()
13+
public function standardAction(?string $value = null)
1314
{
14-
15+
$this->view->assign('value', $value);
1516
}
1617
}

Resources/Private/Templates/Page/Standard.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,7 @@
2929
<f:section name="Main">
3030
<f:cObject typoscriptObjectPath="lib.default_menu" />
3131
<f:cObject typoscriptObjectPath="lib.default_content" />
32+
<h4>Argument passed to controller</h4>
33+
<p><f:link.action action="standard" arguments="{value: 'A value'}">Pass value to controller</f:link.action></p>
34+
<p>{value}</p>
3235
</f:section>

0 commit comments

Comments
 (0)