[TYPO3-dev] Template integration in own extension
bernd wilke
xoonsji02 at sneakemail.com
Wed Jun 17 16:26:11 CEST 2009
On Wed, 17 Jun 2009 15:46:35 +0200 Philipp Hoffmann wrote:
> Hello together,
> I try to integrate templates in my extension using the BE flexform.
> Unfortunatelly the code below doesn't work. But when I integrate the
> variable $fileRessourcePath instead of $templatefile
> it works fine.
> The two variables do, as far as I can see in the output, contain exactly
> the same.
>
> It would be great if someone could help me.
trying to learn PHP? *SCNR*
>
> $piFlexForm = $this->cObj->data['pi_flexform'];
>
> if (!empty($piFlexForm)) {
> $templatefile = substr($piFlexForm,strpos($piFlexForm,'/html/')+6);
nice statement, but next line overwrites:
> $templatefile = $piFlexForm;
> $fileRessourcePath =
> "fileadmin/templates/ph_fewo/phfewo_template.html";
> $this->template=$this->cObj->fileResource('$templatefile');
did you notice that you inserted the variablename in "'"?
you want to open the file with the name '$templatefile' instead with the
name stored in the variable $templatefile
> } else {
> $this->template=$this->cObj->fileResource('EXT:'.$this->extKey.'/
template.html');
> }
bernd
--
http://www.pi-phi.de/t3v4/cheatsheet.html
More information about the TYPO3-dev
mailing list