Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

i cant used this code

 
Post new topic   Reply to topic    Smarty Forum Index -> Help Wanted (commercial)
View previous topic :: View next topic  
Author Message
directphp
Smarty n00b


Joined: 19 Nov 2017
Posts: 2

PostPosted: Sun Nov 19, 2017 3:19 pm    Post subject: i cant used this code Reply with quote

how can used this code in file tpl

Code:
data-frames='[{"from":"y:[100%];z:0;rX:0deg;rY:0;rZ:0;sX:1;sY:1;skX:0;skY:0;","mask":"x:0px;y:0px;s:inherit;e:inherit;","speed":1500,"to":"o:1;","delay":1000,"ease":"Power3.easeInOut"},{"delay":"wait","speed":1000,"to":"auto:auto;","mask":"x:0;y:0;s:inherit;e:inherit;","ease":"Power3.easeInOut"}]'
Back to top
View user's profile Send private message
bsmither
Smarty Pro


Joined: 20 Dec 2011
Posts: 134
Location: West Coast

PostPosted: Sun Nov 19, 2017 5:18 pm    Post subject: Reply with quote

Smarty is not the engine to derive or calculate the value for data-frames. PHP will have to do that.

But once calculated, and the JSON string is assigned to a PHP variable, then...

In PHP, having instantiated the Smarty class:

$smarty->assign('DATA_FRAME_OBJECT_1', $json_string);

The template code will be:

data-frames="{$DATA_FRAME_OBJECT_1}"
Back to top
View user's profile Send private message
directphp
Smarty n00b


Joined: 19 Nov 2017
Posts: 2

PostPosted: Sun Nov 19, 2017 6:35 pm    Post subject: Reply with quote

thank you very much Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Help Wanted (commercial) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP