Example #1
0
 public function build()
 {
     $control = parent::build();
     $activeObject = Yii::createObject($this->config, [$request]);
     $control['data'] = $activeObject->run();
     return $control;
 }
 public function build()
 {
     $control = parent::build();
     $instance = ActiveObject::createObject($this->config);
     $instance->run();
     $control['data'] = $instance->getResponse();
     return $control;
 }
 public function update($value)
 {
     foreach ($value as $key => $fileConfig) {
         $fileConfig['content'] = $this->decodeFile($fileConfig);
         $fileConfig['fileExt'] = strtolower(pathinfo($fileConfig['fileName'])['extension']);
         //$fileConfig['fileName'] = $fileConfig['key'].'.'.$fileConfig['fileExt'];
         unset($fileConfig['key']);
         $file = new File($fileConfig);
         $file->name = uniqid() . '.' . $file->fileExt;
         $file->basePath = is_callable($this->basePath) ? call_user_func($this->basePath, $file) : $this->basePath;
         $file->baseUrl = is_callable($this->baseUrl) ? call_user_func($this->baseUrl, $file) : $this->baseUrl;
         //            $file->fileName = is_callable($this->fileName) ? call_user_func($this->fileName, $file) : $this->fileName;
         //            if (!$file->fileName) {
         //                $file->fileName = $this->createFileName($file);
         //            }
         $this->files[$key] = $file;
         //            $this->renderFile($file);
     }
     parent::update($this->files);
 }
 public function build()
 {
     return array_merge(parent::build(), ['language' => Yii::$app->language]);
 }