I am puzzle.
I put the <cake:nocache> Tag to layout/index.php And it no use too.
And now, the code
  <cake:nocache>
  {#$time#}
  </cake:nocache>
 in /view/index.tpl is parsed as follow in cache file:
<?php echo $this->_tpl_vars['time']; ?>

The value $this->_tpl_vars['time'] is not exist since the smarty
complie not run(cache runed).

Can I get a demo?
Tanks.



On 2月10日, 下午9时52分, "lloydhome" <[EMAIL PROTECTED]> wrote:
> Quote from previous:
>
>    If you use <cake:nocache> it should work as long as the tag is in
> the layout file.
>
> That means it is not working in the included views - like yours.  It
> would not work anyway with your case as no controller would run to set
> $time.  The dynamic part must come from session or other outside
> means.
>
> HTH,
>
> David Lloyd
> --
> lloydhome consultinghttp://lloydhome.com
>
> On Feb 9, 10:57 pm, "rollenc" <[EMAIL PROTECTED]> wrote:
>
> > 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_.txtandneeds
> > > 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 cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to