[TYPO3-ect] Problems with lib/div and smartyView
Simon Tuck
stu at rtpartner.ch
Sun Feb 17 11:50:23 CET 2008
Holger Rüprich wrote:
> @ Simon
>
> > I haven't tried Steffen's latest version, but it looks ok to me. Can
> > you be a bit more specific with what you where expecting?
>
> I'm not sure if I get you right on this one.
me neither ;-)
>
> If you mean the extracted code: I just looked at the new version in the
> svn trunk, but couldn't find the classes viewBase, smartyView or
> phpTemplateEngine? In the version I currently have (Revision: 7333
> 2007-11-30) the render method in the class phpTemplateEngine had the
> folowing code at the beginning:
>
> $this->checkController(__FILE__, __LINE__);
> $path = $this->getPathToTemplateDirectory();
> $path .= substr($path, -1, 1) == '/' ? '': '/';
> $path .=
> strlen($this->controller->configurations->get($configurationKeyOrFileName))
> ?
> $this->controller->configurations->get($configurationKeyOrFileName) :
> $configurationKeyOrFileName;
> $path .= substr($path, -4, 4) == '.php' ? '' : '.php';
>
> And this is what I extracted to the viewBase class, so that both
> subclasses can access it.
The link daniel posted:
https://typo3xdev.svn.sourceforge.net/svnroot/typo3xdev/tx_lib/trunk
goes to the trunk (current revision as I am writing this post is 8276).
The smarty connector is in the class class.tx_lib_smarty.php. I haven't
tried the latest versions, but essentially you would do something like
this (someone pls. correct me if I am wrong):
----
tx_div::load('tx_lib_smarty');
[...]
class my_view extends tx_lib_smarty;
[...]
return $view->render('path/to/template/file.html');
----
Does that help? Hope so...
Cheers,
Simon
More information about the TYPO3-team-extension-coordination
mailing list