[TYPO3-dev] new extension - problem with templating
Brian Bendtsen
nightowl at galnet.dk
Wed Apr 11 12:31:37 CEST 2007
Hi
Im writing a new extension and im testing the use of a html template.
So far I have added this to my TS Setup:
plugin.tx_ebbolig_pi1.mytemplate = FILE
plugin.tx_ebbolig_pi1.mytemplate.file =
fileadmin/templates/boligmodul_template.html
and my php code looks like this:
function main($content,$conf) {
$this->conf=$conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
$this->htmltemplate =
$this->$cObj->cObjGetSingle($this->conf['mytemplate'],
$this->conf['mytemplate']);
$subtemplate = $this->cObj->getSubpart($this->htmltemplate,
'###TEMPLATE_LATEST###');
$substArray=array();
$substArray['###EB_BOLIGNUMMER###'] =
'10000';//this->$getFieldContent("bolignummer");
$content = $this->cObj->substituteMarkerArrayCached($subtemplate,
$substArray);
return $this->pi_wrapInBaseClass($content);
}
}
But this line:
$this->htmltemplate =
$this->$cObj->cObjGetSingle($this->conf['mytemplate'],
$this->conf['mytemplate']);
causes this error message:
Fatal error: Call to a member function cObjGetSingle() on a non-object
Any help is appreciated.
/Brian Bendtsen
More information about the TYPO3-dev
mailing list