1

here is my dilemma I have 2 variables, 1 is an array and one is not. {$variable1} value is "hello"; {sp} value is a multi dimensional array. I use

{php}$xid = $smart->get_template_vars('variable1');{/php}

to assign the variable $xid the value hello. however when I use the same code :

{php}$sparray = $smart->get_template_vars('sp');{/php}

this breaks the code. so the page doesn't load. any suggestions ? p.s: I am trying to get the value of {sp.options.colors} inside the {php} tags

if I use {sp.options.colors} it returns "red" for example. anyway I can get the value inside php ?

1
  • 1
    YOU ARE THE 210,000th PERSON TO TAG A QUESTION WITH PHP! CONGRATS! Commented Apr 4, 2012 at 0:43

1 Answer 1

2

I figured it out : in smarty use $sparray = $this->get_template_vars('sp'); and in php put: $sparray[options][colors];

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.