[TYPO3-UG Dutch] Hook in Pbsurvey
Henjo Hoeksma
hphoeksma at stylence.nl
Wed Aug 6 22:12:17 CEST 2008
Hi list,
hooks is niet mijn favo dingetje - op de e.e.a. heb ik daar nogal
moeite mee om helder te krijgen hoe het werkt (en ja - ik lees de
docu's ) ;-)
Ik wil een hook gebruiken bij pbsurvey en heb de volgende code
gebruikt, met alleen foutmeldingen als "Call to a member function
hookItemProcessor() on a non-object"
Code:
The hook (from pbsurvey)
###
function callHook($arrItem) {
if
(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey][$this->prefixId]['processHookItem']))
{
foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey][$this->prefixId]['processHookItem']
as $_classRef) {
$_procObj = & t3lib_div::getUserObj($_classRef);
$strOutput = $_procObj->hookItemProcessor($arrItem, $this);
}
return $strOutput;
}
}
###
My class (license stripped) class.kopbsurveyext.php
###
<?php
class tx_kopbsurveyext {
function hookItemProcessor($arrItem,&$pObj) {
$content = "test";
return $content;
}
}
?>
###
My ext_localconf.php
###
<?php
if (!defined ("TYPO3_MODE")) die ("Access denied.");
if(TYPO3_MODE != 'BE') {
require_once(t3lib_extMgm::extPath('kopbsurveyext').'class.kopbsurveyext.php');
}
$TYPO3_CONF_VARS['EXTCONF']['pbsurvey']['tx_pbsurvey_pi1']['processHookItem'][]
=
'EXT:kopbsurveyext/class.kopbsurveyext.php:tx_kopbsurveyext';
?>
###
Tips zijn gewenst - bij voorbaat dank!
--
Met vriendelijke groet, kinds regards,
Henjo Hoeksma
Stylence | 2b launched soon!
www.stylence.nl
More information about the TYPO3-UG-dutch
mailing list