Example #1
0
 public function bind(\Nethgui\Controller\RequestInterface $request)
 {
     $idList = array_filter($request->getParameterNames(), function ($p) use($request) {
         return is_array($request->getParameter($p));
     });
     $this->moduleId = \Nethgui\array_head($request->getPath());
     if (!$this->moduleId) {
         return;
     }
     try {
         foreach ($idList as $moduleIdentifier) {
             $moduleInstance = $this->moduleSet->getModule($moduleIdentifier);
             $this->addChild($moduleInstance);
         }
     } catch (\Nethgui\Exception\AuthorizationException $ex) {
         throw $ex;
     } catch (\RuntimeException $ex) {
         throw new \Nethgui\Exception\HttpException('Not found', 404, 1324379722, $ex);
     }
     $this->authorize($request);
     parent::bind($request);
 }
 public function bind(\Nethgui\Controller\RequestInterface $request)
 {
     $this->request = $request;
     foreach ($this->parameters->getKeys() as $parameterName) {
         if ($request->hasParameter($parameterName)) {
             $this->parameters[$parameterName] = $request->getParameter($parameterName);
         }
     }
 }
 protected function calculateKeyFromRequest(\Nethgui\Controller\RequestInterface $request)
 {
     return trim($request->getParameter('localAddress')) . '@' . $request->getParameter('domainAddress');
 }
Example #4
0
 /**
  * Calculate the key value for a new record from the given $request 
  * object.
  * 
  * Override this function whenever the key value requires some kind of 
  * processing to be calculated.
  * 
  * @api
  * @param \Nethgui\Controller\RequestInterface $request
  * @return string
  */
 protected function calculateKeyFromRequest(\Nethgui\Controller\RequestInterface $request)
 {
     return $request->getParameter($this->getKey());
 }