[TYPO3-english] cObj (IMAGE) in backend module

Søren Malling soren.malling at gmail.com
Wed Jan 5 18:30:01 CET 2011


Hi,

Happy new year! :)

The short question: Is it possible to use a cObj in a backend module?

My real issue: A client have created some database records, where one
of the fields are a relation to a file/image. This image can be
uploaded in any resolution. I would like to use the function IMAGE
from tslib_cObj to  create some nice thumbnails of the uploaded
images.

In my backend module the cObj is initialized like this

function init() {
$this->cObj = t3lib_div::makeInstance('tslib_cObj');
}

and used in my main() function like this

$this->content .= $this->cObj->IMAGE(array(
							'file' => $templateObject['previewicon'],
							'file.' => array(
								'maxW' => 200,
								'maxH' => 200
							)
						));

and the error I get is

Fatal error: Call to a member function getFileName() on a non-object
in /opt/local/apache2/htdocs/site/typo3/sysext/cms/tslib/class.tslib_content.php
on line 4916

Can someone shed some light on this issue?

Best regards,

Søren Malling

TYPO3 Brugergruppe Danmark: www.typo3danmark.dk
Twitter: twitter.com/sorenmalling


More information about the TYPO3-english mailing list