Horde_Template::_generatePHPVar PHP Method

_generatePHPVar() protected method

Output the correct PHP variable string for use in template space.
protected _generatePHPVar ( $tag, $key )
    protected function _generatePHPVar($tag, $key)
    {
        $out = '';
        $a = explode('.', $key);
        $a_count = count($a);
        if ($a_count == 1) {
            switch ($tag) {
                case 'arrays':
                    $out = '$this->_arrays';
                    break;
                case 'scalars':
                    $out = '$this->_scalars';
                    break;
            }
        } else {
            $out = '$v' . $this->_foreachMap[implode('.', array_slice($a, 0, -1))];
        }
        return $out . '[\'' . end($a) . '\']';
    }