public function assign($var, $value = null) {

        $invalidProperties = ['__rawContents'];

		if(is_array($var)) {
			foreach($var as $k => $v) {
			    if(in_array($k, $invalidProperties)) {
			        throw new SimpleTemplateException("Tried to assign invalid property '%s'", $k);
                }
				$this->bufferInstance->$k = $v;
			}

			return $this;
		}

        if(in_array($var, $invalidProperties)) {
            throw new SimpleTemplateException("Tried to assign invalid property '%s'", $var);
        }

		$this->bufferInstance->$var = $value;

		return $this;
	}
public function assign($var, $value = null) {

        $invalidProperties = ['__rawContents'];

		if(is_array($var)) {
			foreach($var as $k => $v) {
			    if(in_array($k, $invalidProperties)) {
			        throw new SimpleTemplateException("Tried to assign invalid property '%s'", $k);
                }
				$this->bufferInstance->$k = $v;
			}

			return $this;
		}

        if(in_array($var, $invalidProperties)) {
            throw new SimpleTemplateException("Tried to assign invalid property '%s'", $var);
        }

		$this->bufferInstance->$var = $value;

		return $this;
	}
public function assign ( $ var , $ value = null ) { $ invalidProperties = [ '__rawContents' ] ; if ( is_array ( $ var ) ) { foreach ( $ var as $ k => $ v ) { if ( in_array ( $ k , $ invalidProperties ) ) { throw new SimpleTemplateException ( "Tried to assign invalid property '%s'" , $ k ) ; } $ this -> bufferInstance -> $ k = $ v ; } return $ this ; } if ( in_array ( $ var , $ invalidProperties ) ) { throw new SimpleTemplateException ( "Tried to assign invalid property '%s'" , $ var ) ; } $ this -> bufferInstance -> $ var = $ value ; return $ this ; }
assign value to variable, which is then available within template

@param string | array $var
@param mixed $value
@return SimpleTemplate
@throws SimpleTemplateException
assign value to variable which is then available within template