public function renderPartial($url, array $data = array())
    {
        //Qualify relative template url
        if(!parse_url($url, PHP_URL_SCHEME))
        {
            if(!$template = end($this->__stack)) {
                throw new \RuntimeException('Cannot qualify partial template url');
            }

            $basepath = dirname($template);

            //Resolve relative path
            if($path = trim('.', dirname($url)))
            {
                $count = 0;
                $total = count(explode('/', $path));

                while ($count++ < $total) {
                    $basepath = dirname($basepath);
                }

                $basename = $url;
            }
            else $basename = basename($url);

            $url = $basepath. '/' .$basename;
        }

        if(array_search($url, $this->__stack))
        {
            throw new \RuntimeException(sprintf(
                'Template recursion detected while importing "%s" in "%s"', $url
            ));
        }

        $type = pathinfo( $this->locateSource($url), PATHINFO_EXTENSION);
        $data = array_merge((array) $this->getData(), $data);

        //If the partial requires a different engine create it and delegate
        if(!in_array($type, $this->getFileTypes()))
        {
            $result = $this->getObject('template.engine.factory')
                ->createEngine($type, array('functions' => $this->getFunctions()))
                ->render($url, $data);
        }
        else $result = $this->render($url, $data);

        //Remove the template from the stack
        array_pop($this->__stack);

        return $result;
    }