[TYPO3-mvc] Fluid: form.select view helper and empty default item

KimPixel kimpixel+typo3v4mvc at googlemail.com
Wed Dec 8 12:48:35 CET 2010


Hallo Laurent

I cant believe that this simple requirement is so hard to get work ...
But i need a solution for this.

With the extension of classes is a cleaner way to do this (instead of
the hacking the exbase files like Steffen do).

So can you give me more Information to do it your way?
I don't now to archive this with your small description.

Greetings
KimPixel


2010/8/6 Laurent Foulloy <yolf.typo3 at orange.fr>:
> Hi all,
>
> I have implemented a solution about which I would like your advice:
>
> 1) A class which extends Tx_Extbase_MVC_Controller_Arguments to overload the
> method createArgument().
> 2) A class which extends Tx_Extbase_MVC_Controller_Argument to overload the
> method initializeObject(). This class is instanciated in the previous
> createArgument() method.
> 3) A class which extends Tx_Extbase_Property_Mapper to overload the method
> transformToObject(). This class is instanciated in the previous
> initializeObject() method.
> A slight modification is introduced in transformToObject(). The instruction
> unset($propertyValue['__identity']); is replaced by
>
> if ($propertyValue['__identity'] == 0) {
>  $propertyTagsValues =
> $this->reflectionService->getPropertyTagsValues($targetType, 'uid');
>  if (in_array('AllowUidToBeEqualsToZero', $propertyTagsValues['param'])) {
>    $propertyValue = 0;
>  }
> } else {
>  unset($propertyValue['__identity']);
> }
> It uses the reflection service to check if the uid has an
> "AllowUidToBeEqualsToZero" param attribute.
> 4) The method initializeObjects() is overloaded in the controller. It
> instanciates the previous class.
>
> To use this feature, in the model associated with the foreign table the uid
> variable must be explicitely defined with a @param as follows :
>
> /**
>  * @var int The uid
>  * @param AllowUidToBeEqualsToZero
>  */
>  protected $uid;
>
> Regards
>
> Laurent
>
>
> Laurent Foulloy a écrit :
>
>> Any idea to solve this problem ?
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>


More information about the TYPO3-project-typo3v4mvc mailing list