View previous topic :: View next topic |
Author |
Message |
winus Smarty Rookie
Joined: 22 Dec 2008 Posts: 7
|
Posted: Thu Oct 11, 2012 2:51 pm Post subject: Override compile_check options |
|
|
I have a site driven by smarty, and i let the code the admin's enter a few plugin-codes to make there life easier. So i built a custom resource and all works well. But i have the option compile_check = false...
When they change a line of code in a article the article is never fetched from the database anymore... it stays compiles..
(how) can i force a custom resource to use compile_check = true ? |
|
Back to top |
|
kataxxx Smarty Rookie
Joined: 08 Apr 2012 Posts: 10
|
Posted: Thu Oct 11, 2012 5:56 pm Post subject: Re: Override compile_check options |
|
|
From what I know using smarty,
You edit/create the templates, compile all the templates (Smarty->compile_all something), and then disable compile_check.
Maybe you wanna try that one.
Good luck! |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Oct 12, 2012 12:02 am Post subject: |
|
|
Your database must contain timestamps for this.
See in the /demo/plugins folder resource.mysql.php as an example. |
|
Back to top |
|
winus Smarty Rookie
Joined: 22 Dec 2008 Posts: 7
|
Posted: Fri Oct 12, 2012 10:48 am Post subject: |
|
|
I think i let some information behind.
The resource does have timestamp by the way.
Maybe i am using smarty for what it is not designed for
it's a news site where administrators can add news to.
The news is parsed as a unique template (each item is a unique template).
This gives the option to parse some block functions i use for generating url's
{url id=123}news_detail{url} etc.
Therefor each post, is a template... The full generated page is cached anyway. |
|
Back to top |
|
winus Smarty Rookie
Joined: 22 Dec 2008 Posts: 7
|
Posted: Mon Oct 29, 2012 8:25 am Post subject: |
|
|
Anyone ? If it is not possible it might be a nice feature? |
|
Back to top |
|
kataxxx Smarty Rookie
Joined: 08 Apr 2012 Posts: 10
|
Posted: Wed Oct 31, 2012 2:59 pm Post subject: |
|
|
[quote]Maybe i am using smarty for what it is not designed for [/quote]
I couldn't really understand what you are trying to acchive, but try other solution. One that works with Smarty. You are programmer, you can do it. :)
Try using http://www.smarty.net/docs/en/api.clear.compiled.tpl.tpl (template, template_id). Execute it after the line of code is changed. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Oct 31, 2012 6:54 pm Post subject: |
|
|
compile_check is a global Smarty flag. Because of the internal logic there is no way that a resource can change it's value just during compiling a single template.
So the clearCompiledTpl() function could be your friend. |
|
Back to top |
|
|