[TYPO3-english] extension developement and stdWrap
Dmitry Dulepov
dmitry at typo3.org
Thu Jan 22 15:13:32 CET 2009
Hi!
Stephan Petzl wrote:
> when i create Typoscript which is rendered in my extension with
> cObjGetSingle i want to assign data to the cObj->data array, so that
> stdWrap can access it. i always did it like this:
>
> $this->cObj->data = $row_from_db;
> $MA['###TEXT###'] =
> $this->cObj->cObjGetSingle($this->conf['mytextfield'],$this->conf['mytextfield.']);
You should not override $this->cObj->data because it contains data belonging to the current object. You should create a new instance of the object:
$cObj = t3lib_div::makeInstance('tslib_cObj');
$cObj->start($data);
This will assign data to a new fresh instance of the class.
--
Dmitry Dulepov
TYPO3 core team
"Sometimes they go bad. No one knows why" (Cameron, TSCC, "Dungeons&Dragons")
More information about the TYPO3-english
mailing list