Example #1
0
 /**
  * Lite version of Controller::init method. 
  * Navigator object isn't created and step isn't added, 
  * standard JS and CSS isn't added to the head part.
  *
  * @param null
  * @return nul
  */
 function init()
 {
     $this->trigger("BeforeInit", $this);
     Boot::setupAll();
     $this->header = Header::get();
     $this->dispatcher = new WidgetEventDispatcher();
     $this->display_mode_params = new DisplayModeParams();
     $this->adjacency_list = new WidgetsAdjacencyList();
     $full_path = $this->findPage();
     $dom = new DomDocument();
     if ($dom->load($full_path) === false) {
         throw new ControllerException("Can not load XML " . $full_path);
     }
     $this->restoreSignatures();
     $this->trigger("BeforeHandlePOST", $this);
     if ($_SERVER['REQUEST_METHOD'] == "POST") {
         $this->restoreCheckers();
         $this->parsePageOnPOST($this->processPage($dom));
         $this->handlePOST();
         exit;
     }
     $this->parsePageOnGET($this->processPage($dom));
     $this->inited = true;
     $this->trigger("AfterInit", $this);
 }