[TYPO3-mvc] Fluid: Complex forms best practice

Sebastian Fischer sebastian at fischer.im
Thu Jul 9 17:09:15 CEST 2009


Nikolas Hagelstein schrieb:
> Hi,
>> That does not work currently, cause the property mapper tries to 
>> instantiate a class of type "array"..
> 
> create a class of arrayObject add a generic getter/setter to it and pass it
> over to the template. E.g.
> Class Whatever extends ArrayObject (
> 	.....
> )
> 
> Voila.
> 
> Or use initializeMyAction to put all arguments together...
> 
> 
> Cheers,
> Nikolas
> 
> 

Hi,

i agree that the solution of putting together in the consturct is a 
great idea

class implements ArrayAccess {
	public function __construct() {
		$this->_data = func_get_args();
	}
	
	public function __set($name, $value) {
		$this->_data[$name] = $value;
	}

	public function __get($name) {
		if (array_key_exists($name, $this->_data)) {
			return $this->_data[$name];
		}
	}
}

Maybe something like this would do the job

Greets
Sebastian


More information about the TYPO3-project-typo3v4mvc mailing list