Thx, But I am puzzle in part cache.
I type this code:
controler:
var $view = 'Smarty';
var $helpers = array('Cache');
var $cacheAction = array('index' => 86400, 'view/' => 3600);
function index()
{
$this->set('posts', $this->Test->findAll());
$this->set('time', date('H:i:s', time()));
}
In View
{#foreach from=$posts item=post#}
<h1>{#$post.Test.title#}</h1>
<p>{#$post.Test.body#}</p>
<hr>
{#foreachelse#}
There is nothing
{#/foreach#}
<cake:nocache>
{#$time#}
</cake:nocache>
Website: {#$smarty.server.SERVER_NAME#}
Full page is cached. but nocache tag is ommited.
And the cache file as this:
<cake:nocache>
03:46:08
</cake:nocache>
These is no parse.And the cache is no useful.
What is correct?
On 2月10日, 上午3时12分, "lloydhome" <[EMAIL PROTECTED]> wrote:
> I have a SmartyView that handles caching by utilizing cake's page
> caching. It handles full-page caching great. If you use
> <cake:nocache> it should work as long as the tag is in the layout
> file. I have need for a cachable, non-static ajax call with no layout
> and this solution nor cake's default works for me. So I have an idea
> for that too but you'll need to be patient.
>
> The file is athttp://www.lloydhome.com/files/smarty.ph_.txtand needs
> to be renamed and placed in your /app/views directory.
>
> To use in your controller:
>
> var $view = 'Smarty';
> var $cacheAction = 300; // 5 minutes
> var $helpers = array('Cache');
>
> HTH,
>
> David Lloyd
> --
> lloydhome consultinghttp://lloydhome.com
>
> On Feb 9, 8:42 am, "lloydhome" <[EMAIL PROTECTED]> wrote:
>
> > I also use Smarty but since it is a View and not recognized by the
> > core it is not advantageous to use its caching. I would argue that
> > this it actually better to not try without good reason. The problem
> > with this approach is the logic still occurs in the controller ad the
> > only time savings is in rendering the view.
>
> > The SmartyView doesn't cache the output the way cake wants it but I
> > have some ideas on that I am going to try... It will be easy to setup
> > whole page caching but using <cake:nocache> will be harder. I'll post
> > back with what I find.
>
> > David Lloyd
> > --
> > lloydhome consultinghttp://www.lloydhome.com
>
> > On Feb 9, 4:39 am, "rollenc" <[EMAIL PROTECTED]> wrote:
>
> > > I combine smarty & cackephp followng this article: http://
> > > projects.simpleteq.com/CakePHP/smarty.html
> > > but I don't know how to use smarty cache .
> > > Call for help. Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---