|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
bkfsec Smarty n00b
Joined: 17 Jan 2018 Posts: 1
|
Posted: Wed Jan 17, 2018 8:08 pm Post subject: How pass array from tpl file to php page |
|
|
Hi, I have a query result saved in an array this way
Code: | {assign var = dataResources value = $ Report-> GetData () -> Rows ()} |
now I want to pass this array on a php page
how can I do?
this is the array:
Code: | Array ( [0] => Array ( [owner_name] => Sale [start_date] => 2018-01-04 13:00:00 [end_date] => 2018-01-04 18:00:00 [resource_name] => Plus [resource_id] => 5 ) [1] => Array ( [owner_name] => Sale [start_date] => 2018-01-17 14:00:00 [end_date] => 2018-01-17 17:00:00 [resource_name] => Pharma Plus [resource_id] => 5 ) [2] => Array ( [owner_name] => Plus [start_date] => 2018-01-17 17:00:00 [end_date] => 2018-01-17 18:00:00 [resource_name] => Plus [resource_id] => 5 ) ) 1 |
I am try in this way :
Code: | <a href="../../Page.php?f={$dataResource|@json_encode|rawurlencode}">
<input type="button" value="Create Invoice" style="float: right;">
</a> |
But the dataResource is null |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Jan 18, 2018 1:49 pm Post subject: |
|
|
Why don't you pass that variable from your PHP code?
Placing business logic in your templates is so much PHP3 style. |
|
Back to top |
|
|
|
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
|