source->name}:\${$var} ="; $output .= $ptr->hasVariable($var) ? preg_replace('/\s/', '', var_export($ptr->getValue($var), true)) : '>unassigned<'; $i = 0; while (isset($ptr->_var_stack[ $i ])) { $output .= "#{$ptr->_var_stack[ $i ]['name']} = "; $output .= isset($ptr->_var_stack[ $i ][ 'tpl' ][$var]) ? preg_replace('/\s/', '', var_export($ptr->_var_stack[ $i ][ 'tpl' ][$var]->value, true)) : '>unassigned<'; $i ++; } $ptr = $ptr->parent; } elseif (in_array('data', $types) && $ptr instanceof DataObject) { $output .= "#data:\${$var} ="; $output .= $ptr->hasVariable($var) ? preg_replace('/\s/', '', var_export($ptr->getValue($var), true)) : '>unassigned<'; $ptr = $ptr->parent; } else { $ptr = null; } } if (in_array('global', $types)) { $output .= "#global:\${$var} ="; $output .= $template->smarty->hasVariable($var) ? preg_replace('/\s/', '', var_export($template->smarty->getValue($var), true)) : '>unassigned<'; } return $output; }