protected function _getVarsForOutput() { $output = array(); foreach ($this->_vars as $name => $value) { $output[] = sprintf('%s = %s', $name, json_encode($value)); } return $output ? sprintf('var %s;', implode(', ', $output)) : null; }