コード例 #1
0
ファイル: Runner.php プロジェクト: nishimura/laiz
 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;
 }
コード例 #2
0
ファイル: Initializer.php プロジェクト: nishimura/laiz
 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);
     }
 }