/**
  * Pass the request object and path segments to all of its children
  * 
  * @param \Nethgui\Controller\RequestInterface $request 
  */
 public function bind(\Nethgui\Controller\RequestInterface $request)
 {
     foreach ($this->getChildren() as $module) {
         if ($module instanceof \Nethgui\Controller\RequestHandlerInterface) {
             $module->bind($request->spawnRequest($module->getIdentifier()));
         }
     }
 }
Example #2
0
 protected function bindPosition(\Nethgui\Controller\RequestInterface $request)
 {
     $A = $this->getAdapter();
     $position = \Nethgui\array_head($request->getPath());
     $id = $request->spawnRequest($position)->getParameter('id');
     if (isset($id, $A[$id])) {
         $this->copyDefaults = \iterator_to_array($A[$id]);
     }
     return $position;
 }
 /**
  * Overrides Composite bind() method, defining what is the current action
  * and forwarding the call to it.
  *
  * @param \Nethgui\Controller\RequestInterface $request 
  */
 public function bind(\Nethgui\Controller\RequestInterface $request)
 {
     $this->request = $request;
     $actionId = $this->establishCurrentActionId();
     if ($actionId === FALSE) {
         return;
         // don't bind the request to any action. Render action index.
     }
     $this->currentAction = $this->getAction($actionId);
     if (is_null($this->currentAction)) {
         throw new \Nethgui\Exception\HttpException('Not Found', 404, 1322148401);
     }
     if ($this->currentAction instanceof \Nethgui\Controller\RequestHandlerInterface) {
         $this->currentAction->bind($request->spawnRequest($actionId));
     }
 }