[SOLVED]How do we access nested array items via smarty?
Posted: Tue Apr 30, 2013 7:34 pm
It's been a long time since I've done this and I am trying to get back into the swing of things. Within SMARTY, I am able to view and access all of my basic template variables with..
and even be more specific by looking up things like $fields from the Form Builder module...
But how do we access nested arrays, for example my custom $fields array in Form Builder contains....
...And all I want to do is remember how to access value for [name] and array values for [input].
Thanks for any advice
Code: Select all
{get_template_vars}
Code: Select all
<pre>
{$fields|print_r}
</pre>
Code: Select all
[sdatepicker] => stdClass Object
(
[display] => 1
[required] => 0
[required_symbol] =>
[css_class] => session-block sdatepicker
[helptext] =>
[field_helptext_id] => fbrp_ht_40
[valid] => 1
[error] =>
[hide_name] => 0
[has_label] => 1
[needs_div] => 1
[name] => Next Appointment Date
[input] => Array
(
...
...And all I want to do is remember how to access value for [name] and array values for [input].
Thanks for any advice