function executeRequest() { $my_path = Request::getRequestPath(); $my_name = Request::getRequestName(); $peer = new PaginePeer(); $peer->path__EQUAL($my_path); $peer->nome__EQUAL($my_name); $all_pages = $peer->find(); $my_page = $all_pages[0]; $peer_ep = new ElementiPaginaPeer(); $peer_ep->id_pagina__EQUAL($my_page->id); $all_elementi_pagina = $peer_ep->find(); /* * Carico tutti gli elementi pagina * Nel nome di un settore eventualmente ci posso mettere una descrizione * */ foreach ($all_elementi_pagina as $elem) { $categoria = $elem->categoria; $sotto_categoria = $elem->sotto_categoria; $specifica = $elem->specifica; $categoria_instance = __create_instance(StringUtils::underscored_to_camel_case($categoria) . "SectorRenderer"); $result = $categoria_instance->{$sotto_categoria}($specifica); set_sector($elem->path_settore, $result); } /* * Questi rendering popolano i vari settori a modo loro * */ //render pagina render(PageData::instance()->get("/")); //trova il layout e renderizza il tutto. }
public function handleRequest() { $requestPath = Request::getRequestPath(); $requestPath = ltrim($requestPath, '/'); if (!$requestPath) { $requestPath = 'Index'; } $this->findController($requestPath); if (!$this->foundController) { throw new Error('The request URL is not exists', 404); } }
public function handleRequest() { $requestPath = Request::getRequestPath(); $requestPath = ltrim($requestPath, '/'); if (!$requestPath) { $requestPath = 'Index'; } Filter::preRoute($requestPath); $this->findController($requestPath); if (!$this->foundController) { throw new Error(I18N::parse('Error.Messages.PageNotExists', 'The request URL is not exists'), 404); } }
public function handleRequest() { $requestPath = Request::getRequestPath(); $requestPath = ltrim($requestPath, '/'); if (stripos($requestPath, 'skin/') !== false) { global $skin_user; $skin_user = $requestPath; $requestPath = 'Skin.json'; } if (!$requestPath) { $requestPath = 'Index'; } Filter::preRoute($requestPath); $this->findController($requestPath); if (!$this->foundController) { throw new Error('The request URL is not exists', 404); } }
/** * Get the complete URL of the request. * @return string */ function getRequestUrl() { static $requestUrl; if (!isset($requestUrl)) { $requestUrl = Request::getProtocol() . '://' . Request::getServerHost() . Request::getRequestPath(); HookRegistry::call('Request::getRequestUrl', array(&$requestUrl)); } return $requestUrl; }
function testGetRequestPath() { $this->assertEqual(Request::getRequestPath("/prova/"), "/prova/", "Il path non corrisponde a /prova/ !! : " . Request::getRequestPath("/prova/")); $this->assertEqual(Request::getRequestPath("/"), "/", "Il path non corrisponde a / !! : " . Request::getRequestPath("/")); $this->assertEqual(Request::getRequestPath("/prova/ugh/ciao.php"), "/prova/ugh/", "Il path non corrisponde a /prova/ugh/ !! : " . Request::getRequestPath("/prova/ugh/ciao.php")); }