/** * Convert data to array * @return array */ public function toArray() { $parents = array(); foreach ($this->parents as $p) { $parents[] = (string) $p->getName(); } if ($this->controller) { $parents[] = (string) $this->controller->getName(); } if ($this->action) { $parents[] = (string) $this->action; } return $parents; }
private function _decorateController(Zoombi_Controller &$a_controller) { if (isset($a_controller->action)) { $a_controller->addAction($a_controller->action); unset($a_controller->action); } if (isset($a_controller->model)) { if (is_string($a_controller->model)) { $a_controller->setModels(explode(' ', $a_controller->model)); } if (is_array($a_controller->model)) { $a_controller->setModels($a_controller->model); } unset($a_controller->model); } if (isset($a_controller->helper)) { $helpers = array(); switch (gettype($a_controller->helper)) { default: $this->triggerError("Controller '{$a_controller->getName()}': has wrong helper type.", Zoombi_Exception_Controller::EXC_MODEL); break; case 'string': $helpers = explode(' ', trim($a_controller->helper)); break; case 'array': $helpers =& $a_controller->helper; break; } foreach ($helpers as $h) { $name = Zoombi_String::normalize($h); if (empty($name)) { continue; } $loader =& $this; if (substr($name, 0, 1) == Zoombi::SS) { $loader =& Zoombi::getApplication()->getLoader(); $name = substr($name, 1); } if (!$loader) { if ($this->getModule()->isMode(Zoombi_Module::MODE_DEBUG)) { $this->triggerError('Bad loader'); } } try { $loader->helper($name); } catch (Zoombi_Exception_Helper $e) { if ($this->getModule()->isMode(Zoombi_Module::MODE_DEBUG)) { $this->triggerError($e); } } } unset($a_controller->helper); } if (isset($a_controller->map)) { if (is_array($a_controller->map)) { $a_controller->setMaps($a_controller->map); } if (is_object($a_controller->map)) { $a_controller->setMaps(get_object_vars($a_controller->map)); } unset($a_controller->map); } }