[TYPO3-50-general] Beer3 - Array Syntax and View Helpers

Franz Koch typo.removeformessage at fx-graefix.de
Wed Oct 29 08:41:04 CET 2008


Hi Sebastian,

> View Helpers
> ==========
> 
> I tried to look onto some other projects (namely grails) and wanted to 
> figure out what view helpers we might need as a basis. I thus talked to 
> Ingmar and Ernesto, and together we have made the list you can find at  
> http://forge.typo3.org/wiki/package-beer3/View_Helpers
> 
> It would be really great if you read over these things and tell me if 
> something is missing, the syntax is confusing, or you would prefer one 
> variant over the other (<f3:loop...> vs <f3:for...> as an example).

as I already wrote you, I'd like to see a TS-object-rendering View 
Helper as a basis helper. Something like:

<f3:tsobject configuration="TSpath.to.object" default="some value" 
additionaldata=dummyrecord />

Parameters:
- configuration: Path to the TS object (mandatory)
- default: equals "current" in TS1/v4 (optional)
- additionaldata: model or array that should be available while 
rendering the object. Equals $this->cObj->data in v4 and by default the 
data from the view object are used. (optional)

So this construct would equal the following php lines in v4 (don't know 
how it's currently handled in v5):
---------
// I assume that a valid cObject is already present
function tsobject($configuration,$default=false,$additionaldata=false) {
	if(is_array($additionaldata)) {
		$this->cObject->data = $additionaldata
	} else if (is_object($additionaldata)) {
		$this->cObject->data = $additionaldata->getParameterAsArray();
	}
	if($default) {
		$this->cObject->setCurrentVal($default);
	}
	// I know this line won't work in v4, but it's only a example
	return $this->cObject->cObjGetSingle($configuration);
}
---------

something like that. It's just a quick sketch and a better naming needs 
to be found. Just to get the idea.



And there should be some Helper to render widgets or how ever that will 
be handled.

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-5_0-general mailing list