[TYPO3-dev] $this->cObj->IMAGE error in a extension can't show in FE
Björn Pedersen
pedersen at frm2.tum.de
Wed May 11 17:12:10 CEST 2011
Am 11.05.2011 16:57, schrieb Unai Aizpurua:
> Hi All,
>
> I'm developing a very simple extension to list some images and titles.
>
> I have this code in the PHP:
>
> $conf_image = array(
> "file" => "uploads/tx_imagelist/johnd.jpg",
> "width" => "200",
> "height" => "320",
> );
> $image_element= $this->cObj->IMAGE($conf_image);
> echo "<img src='".$image_element."'/>";
>
> And alway get the same error:
>
> Fatal error: Using $this when not in object context in
> G:\servidorweb\prueba\fileadmin\lib\showElements.inc on line 244
>
> I must do something else to get it in frontend?
>
> Thanks in advance.
>
It seems, you just developing a php-script. And there you have probably
just a function, not a class.
If you want to use the full power, you should really create a true
extension.
Björn
More information about the TYPO3-dev
mailing list