Submit a ticket into Cake trac - Ticket #6454. On Sun, Jun 21, 2009 at 10:33 AM, joshua <[email protected]> wrote:
> I have given a try of Smarty, it seems that we couldn't use echo in element > view if we want to use smarty. > > *Fatal Error* (256): Smarty error: > > [in xxx\app\views\elements\project_list.ctp line 31]: > syntax error: unrecognized tag 'echo' (Smarty_Compiler.class.php, line 590) > [*APP\vendors\smarty\Smarty.class.php*, line *1093*] > > A little disappoint. > > On Sun, Jun 21, 2009 at 8:03 AM, joshua <[email protected]> wrote: > >> If we can integrate Smarty into our App, is that means there is no need to >> implement these cache functions anymore? >> >> >> On Sun, Jun 21, 2009 at 2:45 AM, rod <[email protected]> wrote: >> >>> >>> Hi >>> I'm also trying pagination data caching. I've "successfully" cached >>> the data, however it doesn't appear to be caching other pagination >>> params like pageCount >>> I get: Undefined index: pageCount [CORE\cake\libs\view\helpers >>> \paginator.php, line 473] >>> >>> I think I should also cache $this->params["paging"]; >>> Any ideas? >>> Thanks >>> >>> On Jun 19, 7:09 am, Jon Bennett <[email protected]> wrote: >>> > Hi Joshua, >>> > >>> > > Thanks your reply! Is that means if we want to use the sort or >>> paginate >>> > > function , we shouldn't use the view cache feature in our >>> application? I >>> > > want to know what you will do if you want to improve your application >>> > > performance? Is there any friends who use the view cache feature in >>> your >>> > > application ? >>> > >>> > You can still use caching, but not on the view, although you could >>> > create an element for each alternative sort, eg: >>> > >>> > /elements/tables/data_name_asc >>> > /elements/tables/data_name_desc >>> > /elements/tables/data_created_desc >>> > >>> > I'd have thought that was pretty inefficient though, and certainly >>> > doesn't scale well! I would cache the data returned by paginate. >>> > You'll need to cache each dataset, eg, for every change of sort and >>> > direction, but the element can stay the same. Something like: >>> > >>> > // Cache name - just a simple example >>> > $cacheName = $this->name.'_'.$this->action.'_'.join('-', >>> > $this->paginate[$this->modelClass]); >>> > >>> > // Look for cached data >>> > if (($this->data = Cache::read($cacheName) === false) >>> > { >>> > // Didn't find any so get data >>> > $this->data = $this->paginate($this->modelClass, $conditions); >>> > // write to cache >>> > Cache::write($cacheName, $this->data); >>> > >>> > } >>> > >>> > hth >>> > >>> > Jon >>> > >>> > jon bennett >>> > w:http://www.jben.net/ >>> > iChat (AIM): jbendotnet Skype: jon-bennett >>> >>> >>> >> >> >> -- >> Thanks >> Joshua >> > > > > -- > Thanks > Joshua > -- Thanks Joshua --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~----------~----~----~----~------~----~------~--~---
