Root-level variable assignment. Adds to current assignments, overriding
any existing variable assignment with the same name.

@param array $vararray Variables

@return bool
771748
function assign_vars($vararray)
    {
        reset($vararray);
        while (list($key, $val) = each($vararray)) {
            $this->_tpldata['.'][0][$key] = $val;
        }

        return true;
    }
246915
public function setVars($variables)
    {
        if (!is_array($variables) && !$variables instanceof ArrayAccess) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Expected array or ArrayAccess object; received "%s"',
                (is_object($variables) ? get_class($variables) : gettype($variables))
            ));
        }

        // Enforce a Variables container
        if (!$variables instanceof Variables) {
            $variablesAsArray = array();
            foreach ($variables as $key => $value) {
                $variablesAsArray[$key] = $value;
            }
            $variables = new Variables($variablesAsArray);
        }

        $this->__vars = $variables;
        return $this;
    }
310900
public function query_vars( array $vars ){
        if( !empty($this->query_var) ){
            foreach( $this->query_var as $var ){
                if( false === array_search($var, $vars) ){
                    $vars[] = $var;
                }
            }
        }
        return $vars;
    }
1260040
public function add($varname, $value)
    {
        if ($this->exists($varname)) {
            return false;
        }

        $this->_vars[$varname] = $value;
        return true;
    }
692121
public function setVars($vars, $clear = false)
    {
        if ($clear) {
            $this->vars = $vars;
        } else {
            if (is_array($vars)) $this->vars = array_merge($this->vars, $vars);
        }
        return $this;
    }
1284807
public function addTemplateVars(array $vars)
    {
        foreach($vars as $key => $value)
        {
            $this->addTemplateVar($key, $value);
        }

        return $this;

    }
914007
function assign($name,$value=null){
        if(is_array($name)){
            foreach($name as $vk => $v){
                $this->vars[$vk] = $v;
            }
        }else{
            $this->vars[$name] = $value;
        }   
    }
845263
function hasLocalVariable( $varName, $rootNamespace )
    {
        return ( array_key_exists( $rootNamespace, $this->CurrentLocalVariablesNames ) &&
                 array_key_exists( $varName, $this->CurrentLocalVariablesNames[$rootNamespace] ) );
    }
777362
public function trackDefinedVariables( $variables )  {
		if ( !is_array( $variables ) ) {
			$variables = $this->matchVariables( $variables );
		}

		$this->definedVariables = array_unique( array_merge( $this->definedVariables, $variables ) );
	}
142270
public function setAll($variables)
    {
        $vars = array();
        foreach ($variables as $k => $v) {
            $vars[] = array('key' => $k, 'value' => $v);
        }
        return $this->setArgument("variables", $vars);
    }
455384
function setLocalVariable( $varName, $varValue, $rootNamespace )
    {
        $this->CurrentLocalVariablesNames[$rootNamespace][$varName] = 1;
        $this->setVariable( $varName, $varValue, $rootNamespace );
    }
477722
public function setVars(array $vars)
    {
        $name = isset($vars['name']) && !empty($vars['name']) ? $vars['name'] : $vars['id'];
        $vars['name'] = $name;

        $this->vars = $vars;

        return $this;
    }
786133
public function parse(array $vars = [])
    {
        foreach ($vars as $_assign_key => $_assign_value) {
            $this->engine->assign($_assign_key, $_assign_value);
        }

        return $this->engine->fetch('string:' . $this->string);
    }
1267788
function assign_block_vars($blockname, $vararray)
    {
        if (strstr($blockname, '.')) {
            // Nested block.
            $blocks = explode('.', $blockname);
            $blockcount = sizeof($blocks) - 1;
            $str = '$this->_tpldata';
            for ($i = 0; $i < $blockcount; $i++) {
                $str .= '[\'' . $blocks[$i] . '.\']';
                eval('$lastiteration = sizeof(' . $str . ') - 1;');
                $str .= '[' . $lastiteration . ']';
            }
            // Now we add the block that we're actually assigning to.
            // We're adding a new iteration to this block with the given
            // variable assignments.
            $str .= '[\'' . $blocks[$blockcount] . '.\'][] = $vararray;';

            // Now we evaluate this assignment we've built up.
            eval($str);
        } else {
            // Top-level block.
            // Add a new iteration to this block with the variable assignments
            // we were given.
            $this->_tpldata[$blockname . '.'][] = $vararray;
        }

        return true;
    }
466970
protected function assignPropertyValues(array $values)
    {
        foreach ($values as $property => $value) {
            if (property_exists($this, $property)) {
                $this->{$property} = $value;
            }
        }
    }
956642
public function set($name, $value)
    {
        if (!$this->has($name)) {
            $this->vars[$name] = $value;
        } else {
            return false;
        }
    }
84760
public function findFirstVariableAssignment(array $statements, $name, $notFoundError = null)
    {
        foreach ($this->filterAssignments($statements) as $assign) {
            if ($assign->var instanceof Variable && $assign->var->name === $name) {
                return $assign;
            }
        }

        throw new \RuntimeException($notFoundError ?: sprintf('Variable assignment $%s not found', $name));
    }