| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Problems passing PHP variables to Smarty templates | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Problems passing PHP variables to Smarty templates
I have created the file "query_parse.php" in the customer directory. Inside that file is the following:
Code:
I am trying to display certain tabs at the top of my site by using the category of the product being displayed using the following code in head.tpl: Code:
Every time I now try to load my site I always receive the error "Fatal error: Call to a member function on a non-object in query_parse.php on line 3". The variable churns out the correct number each time if I remove the "smarty->assign" line and replace that with a "print($arg_value)", so I know that I am getting the information I need. I just can't get it into the template I am using. I have going over and over documentation of PHP and Smarty for the last 4 hours and am at my wits end to explain why I can't pass this variable. I am new to both PHP and Smarty so please bare with me. Thanks, Joshua NOTE: I moved this post from the board "Program Logic" today, this was originally posted on January 4th. |
|||||||
#2
|
|||||||
|
|||||||
Somehow, and for no apparent reason, the problem has stopped giving me the "non-object" error after I 'required' the Smarty.class.php, but any attempt to reload my pages after a change in the template says I can't redeclare a certain variable (sorry, forget name).
Also, I still cannot get variables created in a PHP document to pass into a Smarty template. Any PHP variables or Smarty variables created in a PHP document always contain nothing when inside a template. Variables I assign in a template also don't hold their data no matter what I put in them using the syntax -> Code:
This is most frustrating. If anyone can please enlighten me as to what is going on I would appreciate it. |
|||||||
|
|||
X-Cart forums © 2001-2020
|