By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,389 Members | 1,955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,389 IT Pros & Developers. It's quick & easy.

Cakephp & Smarty problem

P: n/a
Hi!

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.
{
$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 ;)
Aug 30 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.