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;
	}