[TYPO3-english] Extbase pass params to listAction to achive sorting

Jan Bednarik info at bednarik.org
Fri May 2 22:47:55 CEST 2014


Hi all,

I need users to be able to choose sorting in FE, since I didn't find
anything to support this in ExtBase/Fluid, I assume I need to do that
manually. In order to do so, I've added 2 params to default list action
in my controller:

/**
	 * action list
     *
     * @param string $orderBy
     * @param boolean $desc
	 *
	 * @return void
	 */
	public function listAction($orderBy, $desc) {

Then I have action in Fluid:

<f:link.action action="list" arguments="{orderBy : 'title', desc :
false}">^</f:link.action>
    <f:link.action action="list" arguments="{orderBy : 'title', desc :
true}">v</f:link.action>

The constructed URL looks like:

...index.php?id=8&tx_kucerashop_pi1%5BorderBy%5D=price&tx_kucerashop_pi1%5Bdesc%5D=&tx_kucerashop_pi1%5Baction%5D=list&tx_kucerashop_pi1%5Bcontroller%5D=Shopitem&cHash=920ca11013503abd5035b32b95046a31

However, the params are not passed to the listAction and the result is
exception

#1: PHP Warning: Missing argument 1 for
Pixelbox\Kucerashop\Controller\ShopitemController::listAction() in
D:\html\typo62\typo3conf\ext\kucerashop\Classes\Controller\ShopitemController.php
line 53 (More information)

So, any idea where's the problem?

Thanks

Jan


More information about the TYPO3-english mailing list