[TYPO3-dev] Calling $this->cObj->CONTENT from inside a plugin denied

Dmitry Dulepov dmitry.dulepov+t3ml at gmail.com
Mon Mar 1 14:50:15 CET 2010


Hi!

On 2010-03-01 14:57:44 +0200, Sebastian Gebhard said:
> Why is there this restriction? Why am I not allowed to render a CONTENT 
> element inside a plugin?

Because you risk overwriting current content data...

Just make a new copy of cObj and use it:

$cObj = t3lib_div::makeInstance('tslib_cObj');
$cObj->start(array(), '');

By the way, you should not call CONTENT directly, you should use 
cObjGetSingle() call instead.

Get my TYPO3 extension development book. It has lots of stuff like that 
in examples...

-- 
Dmitry Dulepov
TYPO3 expert / TYPO3 security team member 
Read more @ http://dmitry-dulepov.com/





More information about the TYPO3-dev mailing list