Exemplo n.º 1
0
 public static function prepare($obj, array $config)
 {
     $container = Container::getInstance();
     $request = $container->create('laiz.action.Request');
     $request->setRequestsByConfigs($config);
     Util::setPropertiesByRequest($request, $obj);
     Builder::initObject($obj, $config);
     return $obj;
 }
Exemplo n.º 2
0
 public function run(array $configs)
 {
     $this->request->setRequestsByConfigs($configs);
     $a = new StdClass();
     if (isset($configs['property'])) {
         foreach ($configs['property'] as $key => $val) {
             $a->{$key} = $val;
         }
     }
     // override property used request
     Util::setPropertiesByRequest($this->request, $a);
     // Setting Arguments from Request for a template.
     if (isset($configs['pathinfo'])) {
         foreach ($configs['pathinfo'] as $key => $val) {
             $a->{$key} = $this->request->get($key);
         }
     }
     $this->response->addObject($a);
     foreach ($this->results as $result) {
         $this->response->addObject($result);
     }
 }