0

Problem: Content of user function is rendered as plain text.

This is my class.aktionen.php:

<?

class user_aktionen {

  private $conf;

  function main($content,$conf) {
    $this->conf = $conf;

    return 'test';
  }

}
?>

This is my TS:

includeLibs.user_aktionen = fileadmin/templates/class.aktionen.php

lib.offers = USER_INT
lib.offers {
  userFunc = user_aktionen->main
}

I have mapped lib.offers with TemplaVoila onto a div element. The rendered output of my HTML-Document is

<?

class user_aktionen {

  private $conf;

  function main($content,$conf) {
    $this->conf = $conf;

    return 'test';
  }

}
?><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="de-DE" lang="de-DE" xmlns="http://www.w3.org/1999/xhtml">

I'm using Templavoila 1.8.0 and Typo3 4.7.10.

What I'm doing wrong?

Is it a permission problem? Should I use Templavoila 1.7 instead? I tried

$TYPO3_CONF_VARS['FE']['debug'] = '1';
$TYPO3_CONF_VARS['SYS']['devIPmask'] = '127.0.0.1'; // your real IP here
$TYPO3_CONF_VARS['SYS']['displayErrors'] = '2';

and php_flag display_errors on in .htaccess but I don't see an error at all.

testing
  • 19,681
  • 50
  • 236
  • 417
  • It could also be that the server is not configured to interpret *.php files correctly. I respectfully disagree, we cannot tell for sure whether this is a duplicate yet (although, yes, it is likely to be). – RandomSeed Mar 19 '13 at 21:17
  • @Charles: You're right. The short tags are not configured on the server. Don't know why I have overseen that. Thanks for your help. – testing Mar 20 '13 at 08:13
  • @testing Instead of editing your question, please kindly post the solution as an answer to your own question and accept it. This way, the question does not show anymore as "unanswered". – RandomSeed Mar 20 '13 at 09:03

1 Answers1

1

Thanks to Charles here is the solution:

Short tags (<? ?>) are not configured on the server. Switching to <?php ?> solved the problem.

testing
  • 19,681
  • 50
  • 236
  • 417