[TYPO3-mvc] How to make prependOption work without hacking fluid
Visay Keo
typo3 at visay.info
Wed Feb 16 14:01:37 CET 2011
Hi Bastian,
Thanks for your answer. I will take the first option with my extension.
I also tried the second option and it works but the value 'please
select' doesn't show, just an empty field.
Best,
Visay
On 02/16/2011 12:01 AM, Bastian Waidelich wrote:
> Visay Keo wrote:
>
> Hi,
>
>> From the previous post of this list, I hacked fluid to register new
>> argument "prependOption" to selectViewHelper and it's always there and
>> working. Whenever fluid is updated, I have to remind myself about adding
>> that.
>
> You have several options:
> The quickest is probably to copy the modified ViewHelper to your
> extension and use that like:
> {namespace x=Tx_YourExtension_ViewHelpers}
> <x:form.select [...]
>
> The other option could be, to add the empty option in your controller
> already:
>
> $clients = $this->clientRepository->findAll()->toArray();
> array_unshift($clients, array('' => 'please select'));
> $this->view->assign('clients', $clients);
>
> [...]
>
> <f:form.select options="{clients}" [...]
>
>
> I know that both ways are not perfect. But rest assured that the next
> version will have this feature!
>
> Best,
> Bastian
More information about the TYPO3-project-typo3v4mvc
mailing list