public function setRegion($region, $item)
    {
        if (is_array($item)) {
            $template = array_shift($item);
            $data = $item ? reset($item) : array();
            $content = $this->render($template, $data);
        } else {
            $content = trim($item);
        }

        if ($content !== '' && isset($this->templates["region_$region"])) {

            $weight = 1;

            if (isset($this->data["region_$region"])) {
                $weight = count($this->data["region_$region"]) + 1;
            }

            $this->data["region_$region"][] = array('rendered' => $content, 'weight' => $weight);
        }
    }