OK, to implement the filtering, render also implements needs a little
reworking because its set as private ??, he is how my template view
works now
Render just passed through $name which is the filename of the template
to run, the fullpath the normal render adds is not neccessary because
ive added the base template path to the template engines config in the
contructor. Unfortunately I cant find a way to reset that dynamically.
public function render($name)
{
return $this->_filter($this->_run($name));
}
private function _filter($buffer)
{
// loop through each filter class
foreach ($this->getFilters() as $name) {
// load and apply the filter class
$filter = $this->getFilter($name);
$buffer = call_user_func(array($filter, 'filter'), $buffer);
}
// done!
return $buffer;
}
protected function _run()
{
$this->_flexy->compile(func_get_arg(0));
return $this->_flexy->bufferedOutputObject($this);
}
Dan Rossi wrote:
Hmm looks like I'll revert back to some of the old code which uses the
abstract _run method. If thats not added it wants you to implement all
the implement methods, which I dont really need to touch and keep them
all standard, because the object vars are all passed via $this, and
doesnt need any kludgy assigning stuff.
Dan Rossi wrote:
That looks like a more articulate version of my smarty version I
found around the traps. Will update it ! Althought I use flexy
instead of smarty, so the getter and setters work out of the box as
its all return to the template via $this.
Christer Edvartsen wrote:
You should check out the Zend_View part of the ZF documentation:
http://framework.zend.com/manual/en/zend.view.scripts.html#zend.view.scripts.templates
appel wrote:
Hi,
This is my first time using Zend Framework, I've used my own
framework for a
while, which has a Smarty support, and I would like to continue to use
Smarty for caching purposes, besides it's a nice template system.
I've been Googling around for guidance to adding Smarty support to
my Zend
framework, but I'm really confused. I do get solutions all right,
but every
single blogger and poster out there seems to have made their own
solution.
So it's very hard to asses which solution is the best, there are
dozens of
them, and many of them aren't even complete.
Since Smarty is such a popular template system for PHP, there must
be a
proper, more official, implementation for this for Zend?
Thank you.