Пример #1
0
 public function renderResult()
 {
     $request_part = Request::getRequestPart();
     $dot_pos = strpos($request_part, ".");
     $page_name = substr($request_part, 1, $dot_pos - 1);
     $page = PageFactory::create($page_name, new DataHolder());
     Params::push();
     Params::importFromPost(false);
     Params::importFromGet(true);
     ob_start();
     $page->render();
     $page_result = ob_get_contents();
     ob_end_clean();
     Params::pop();
     PageData::instance()->set(Html::get_default_content_save_path(), $page_result);
     render(PageData::instance()->get("/"));
     //trova il layout e renderizza il tutto.
 }
Пример #2
0
 function execute()
 {
     Params::push();
     //callback a cui è possibile linkarsi
     $this->__before_dispatch_action();
     //posso agire su action, format e params ...
     $this->__execute_action();
     //trasformo i dati ...
     if ($this->is_error) {
         $final_result = $this->format_helper->formatError($this->action_result);
     } else {
         $final_result = $this->format_helper->formatOutputData($this->action_result);
     }
     //callback a cui è possibile linkarsi
     $this->__after_dispatch_action();
     //da vederne ancora l'utilizzo, eventualmente concatenare altre azioni??
     Params::pop();
     //tolgo i parametri dalla pila
     if ($final_result instanceof IActionCommand) {
         $final_result->execute();
         return null;
     } else {
         return $final_result;
     }
 }