[TYPO3] strange behavior of USER object

Stano Paška stanislav.paska at kios.sk
Tue Oct 3 10:04:21 CEST 2006


Hi,

I want use my function in template.
But it does not work. I tried some example, it works ok. I try add my function into example class, it works too.
But when I want write my own class, it does not work.

Do you have some advice?
Is there some naming convention?

user_functions->uploads works
renderer_aaa->uploads_aaa does not work, it writes only 'include works'
I tried remove user_functions class, in that file was only renderer_aaa class, but it doesn't help.

Thanks for answers

Stano.

P.S. Of course I cleared cache everytime.
Example from TSref works too.

my template:
#-------------------

# Default PAGE object:
page = PAGE
page.typeNum = 0
includeLibs.some_random_id_string = fileadmin/lib/lib.php

page.20 = COA
page.20.10 = USER
page.20.10.userFunc = user_functions->uploads
page.20.10.factor = 15


my lib.php:
#-------------------
<?php

var_dump('include works');

class user_functions {

	/**
	 * Multiplies the current page ID with $conf["factor"]
	 */
	function multiplyTest($content,$conf)	{
		$currentPageUid = $GLOBALS['TSFE']->id;
		$factor = intval($conf['factor']);
		
		return $currentPageUid * $factor;
	}

	function uploads($c, $a) {
		return 'some content';
	}
}

class renderer_aaa {

	/**
	 * Reference to the parent (calling) cObj set from TypoScript
	 */
	var $cObj; 

	function uploads_aaa($content, $conf) {
var_dump('call does not work');
		return 'some content';
	}

}

?>





More information about the TYPO3-english mailing list