Re: [SMARTY] Generate cache with an array as identifier
| From: | messju mohr | Date: | Thu, 20 Mar 2003 19:09:56 +0000 |
| Subject: | Re: [SMARTY] Generate cache with an array as identifier | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8788@lists.php.net to get a copy of this message | ||
On Thu, Mar 20, 2003 at 11:00:07AM -0800, Jacques Jocelyn wrote:
> Hello all,
>
> I am implementing smarty in an existing application and I have some
> difficulties with the cache.
>
> when I have to generate the cache for a single variable, I use the
> following :
> if(!$tpl->is_cached("mytemplate.tpl","mypage|$myvar|$myvar2"){
> // database query for my two variables $myvar & $myvar2
> // assign smarty variables
> // ..
> }
>
> Now my variables are arrays.
> it's coming from an html form with the attributes :
> <select name="myvar[]" multiple>
> <option value=1>text1</option>
> <option value=2>text2</option>
> <option value=3>text3</option>
> </select>
>
> The select fields might contain 3 value or 20. this is dynamic
> coming from a Dabatase.
>
> here is my question How can I generate the cache
> if I use the following
> if(!$tpl->is_cached("mytemplate.tpl","mypage|$myvar|$myvar2"){
i guess you want something like this
...
// make "1,2,3" from array
$myvar = implode(',', $value);
if(!$tpl->is_cached("mytemplate.tpl","mypage|$myvar|$myvar2"){
...
> ....
> }
> the cache system creates several sub directories but does not take the
> arrays values
> here is what I have in the cache structure
> /home/website/cache/Array/Array/mytemplate....
>
> Please advise.
>
>
> Best regards,
> Jacques
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Inter Personnel Synergies: Teamwork
Jonas Luster