private function extend_view($text, $params = array())
	{
		// se presente, procedi con l'estensione
		if(strpos($text, '@extends(') !== false)
		{
			// extract the template name
			$pieces = explode('@extends(', $text);
			$pieces = explode(')', $pieces[1]);
			if(count($pieces) <= 0)
				return $text;
			
			$parent_view = new View(ViewUtility::trim($pieces[0]), $params, false);
			$result = $parent_view->render(false);

			// remove all the extends
			foreach (ViewUtility::find_rules($result, '@extends', ')') as $extend) {
				$result = str_replace($extend, '', $result );
			}

			$this->extended = true;
			return $result;
		}
		return $text;
	}