fuel / parser

Fuel PHP Framework - v1.x template parser package adapters
http://fuelphp.com
64 stars 45 forks source link

Smarty - Setting Cache or Compile ID #33

Closed TreeNode closed 13 years ago

TreeNode commented 13 years ago

Unable to set a cache_id or compile_id in a fetch call.

For more info: http://www.smarty.net/docsv2/en/caching.multiple.caches.tpl http://www.fuelphp.com/forums/topics/view/5195#5263

WanWizard commented 13 years ago

There's more wrong here.

The Smarty view class uses fetch() to fetch the smarty template, passing the template data as the second parameter. That doesn't work in Smarty, you have to call assign() on the Smarty object to assign variables to the template, then call fetch().

WanWizard commented 13 years ago

Implementing extra fetch parameters is not that easy, as it would interfere with the way the View class is working.

For custom solutions, like passing the cache_id, either do it like you do now, or extend the View class and overload the process_file method.