public function render()
	{
		// make sure the template to be rendered is defined
		if (empty($this->template))
		{
			throw new \ThemeException('No valid template could be found. Use set_template() to define a page template.');
		}

		// storage for rendered results
		$rendered = array();

		// pre-process all defined partials
		foreach ($this->partials as $key => $partials)
		{
			$output = '';
			foreach ($partials as $index => $partial)
			{
				// render the partial
				$output .= $partial->render();
			}

			// store the rendered output
			if ( ! empty($output) and array_key_exists($key, $this->chrome))
			{
				// encapsulate the partial in the chrome template
				$rendered[$key] = $this->chrome[$key]['view']->set($this->chrome[$key]['var'], $output, false);
			}
			else
			{
				// store the partial output
				$rendered[$key] = $output;
			}
		}

		// assign the partials to the template
		$this->template->set('partials', $rendered, false);

		// return the template
		return $this->template;
	}