Example #1
0
 /**
  * root controller
  *
  * @author Aurélien LEQUOY <*****@*****.**>
  * @license GPL
  * @license http://opensource.org/licenses/GPL-3.0 GNU Public License
  * @param string construct of controller
  * @return boolean Success
  * @description should be called 1 time by request. This factory create the (main) root MVC used in boot and display the output in standard flux. it's this controller witch will determine the layout.
  * @access public
  * @example \Glial\Synapse\FactoryController::rootNode("class", "function", array('param1','param2'));
  * @package Controller
  * @See Also addNode
  * @since 2.1 First time this was introduced.
  * @version 2.1
  */
 public static function rootNode($controller, $action, $param = array())
 {
     $node = new Controller($controller, $action, json_encode($param));
     $node->setDi(self::$di);
     self::$controller = $controller;
     self::$method = $action;
     $node->setRootNode();
     $node->getController();
     if (!empty(self::$di['js'])) {
         $node->setJs(self::$di['js']->getJavascript());
     }
     if (!$node->layout_name) {
         $node->display();
         return false;
     } else {
         $node->setLayout();
         return true;
     }
 }