[TYPO3-dev] $this->cObj->IMAGE error in a extension can't show in FE

Unai Aizpurua unai at alambre.net
Wed May 11 17:24:13 CEST 2011


Thanks for your fast answer!

yes, I'm making a function, I'm not creating a class really.
Can I access to cObj instead, only need to resize images...

Thanks in advance.

El 11/05/11 17:12, Björn Pedersen escribió:
> 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
>


-- 
Unai Aizpurua
unai at alambre.net




More information about the TYPO3-dev mailing list