public function setRegistry($var = null, $val = null, $section = false)
    {
        if (is_null($var)) {
            return;
        }
        if ($section) {
            if (!isset($this->registry[$section])) {
                $this->registry[$section] = array();
            }
            $this->registry[$section][$var] = $val;
        } else {
            $this->registry[$var] = $val;
        }
        return $this;
    }