{adr} is an array of tt_address → FriendsOfTYPO3\TtAddress\Domain\Model\Address i" /> {adr} is an array of tt_address → FriendsOfTYPO3\TtAddress\Domain\Model\Address i" /> {adr} is an array of tt_address → FriendsOfTYPO3\TtAddress\Domain\Model\Address i"/>

usign foreign model in own viewhelper as argument

261 Views Asked by At

From fluid, I call my viewhelper-class <ext:thehelper adr="{adr}" /> {adr} is an array of tt_address → FriendsOfTYPO3\TtAddress\Domain\Model\Address

in the viewhelper I register the argument

    use FriendsOfTYPO3\TtAddress\Domain\Model\Address;
    public function initializeArguments() {
        $this->registerArgument('adr', 'FriendsOfTYPO3\TtAddress\Domain\Model\Address', 'the addresses', true);
    }

this fails with this message: The argument "adr" was registered with type "FriendsOfTYPO3\TtAddress\Domain\Model\Address", but is of type "TYPO3\CMS\Extbase\Persistence\Generic\QueryResult" in view helper

How can I receive the adr-array to work with. Thank You for your help!

1

There are 1 best solutions below

0
Claus Due On BEST ANSWER

If your VH must accept multiple addresses then your ViewHelper argument must not register the class name of whichever object is contained within a query result, as data type.

Instead you must register the argument with type TYPO3\CMS\Extbase\Persistence\Generic\QueryResult.