Cakephp & Smarty problem
am 30.08.2007 10:11:25 von grezlikHi!
I have major problems with cakephp & smarty, (cake ver is 1.2 and smarty =
2.6.18 [iirc])
there is a code (from cake/libs/view/view.php
class SmartyView {
..
..
..
function _render{[params]) {
[some code]
$this->Smarty->assign_by_ref('view', $this);
return $this->Smarty->fetch($__viewFn);
}
}
and problem when calling this method (_render) it always returns white =
chars but template file is'nt empty
if i use code like that:
1.
{
$this->Smarty->assign_by_ref('view', $this);
echo $this->Smarty->fetch($__viewFn);
return $this->Smarty->fetch($__viewFn);
} - everything is ok, echo shows that fetch() returns processed template =
content - return doesnt return this content (!)
2.
{
$this->Smarty->assign_by_ref('view', $this);
// return $this->Smarty->fetch($__viewFn);
return 'xyz';
} - function return string 'xyz' - everything is "ok"
3.=20
{
$this->Smarty->assign_by_ref('view', $this);
define('xyz', $this->Smarty->fetch($__viewFn));
return xyz;
} - everything is ok, function returns what was returned by fetch
so... why return $this->Smarty->fetch($__viewFn);
doesnt work as it should ?
do i have to set something in cakephp configuration or in php.ini ?
im using AppServ 2.5.9 with php 5.2.3
thanks in advance
sry for my english ;)