/** * Render a sub element from within a view. * * Views are not allowed to have business logic, but they can call upon * other generic, shared, views, called elements here. * * @param string $elementName name of element to render * @param array $data optional data to pass to the element. * @return void * @throws Lvc_Exception * @author Anthony Bush **/ protected function getElement($elementName, $data = array()) { $view = Lvc_Config::getElementView($elementName, $data); if (!is_null($view)) { $view->setController($this->controller); return $view->getOutput(); } else { error_log('Unable to render element "' . $elementName . '"'); // throw new Lvc_Exception('Unable to render element "' . $elementName . '"'); } }