[TYPO3] assign return-value of a userfunc via TS to a attribute

Markus Thaler most.wanted at gmx.at
Wed Sep 10 22:48:12 CEST 2008


hello group,

i have got a problem to assign the return-value of a userfunc via TS to a attribute.

------------------------
this (simplyfied) szenario does not work:

### TS ###
includeLibs.id = fileadmin/scripts/id.php
temp.id = USER
temp.id.userFunc = user_id->main
temp.gallery < plugin.tx_rgsmoothgallery_pi1
temp.gallery {
  mode = RECORDS
  startingpointrecords < temp.id
  }
}
page.10.marks.HEADER < temp.gallery
### /TS ###

### id.php ###
<?php
class user_id {
	var $cObj;
	function main($content,$conf) {	
		$content = 9;
		return $content;
	}
}
?>
### /id.php ###
------------------------
this works great:

### TS ###
temp.gallery < plugin.tx_rgsmoothgallery_pi1
temp.gallery {
  mode = RECORDS
  startingpointrecords = 9
  }
}
page.10.marks.HEADER < temp.gallery
### /TS ###
------------------------
this also works:

### TS ###
temp.id = 9
temp.gallery < plugin.tx_rgsmoothgallery_pi1
temp.gallery {
  mode = RECORDS
  startingpointrecords < temp.id
  }
}
page.10.marks.HEADER < temp.gallery
### /TS ###
------------------------
and this writes (as sopposed) the number "9" into the header-mark
(so the userfund returns the number "9", doesn't it?)

### TS ###
includeLibs.id = fileadmin/scripts/id.php
temp.id = USER
temp.id.userFunc = user_id->main
page.10.marks.HEADER < temp.id
### /TS ###

### id.php ###
<?php
class user_id {
	var $cObj;
	function main($content,$conf) {	
		$content = 9;
		return $content;
	}
}
?>
### /id.php ###
------------------------

QUESTION: what did i wrong? does the userfunc return the number "9", or does it return something more/else - something that needs to be treaten in a special way?


More information about the TYPO3-english mailing list