コード例 #1
0
ファイル: FileField.php プロジェクト: johsbk/penguin
 public function __construct($dict = array())
 {
     if (!isset($dict['path'])) {
         throw new FormException('No upload path given');
     }
     $this->path = $dict['path'];
     $this->widget = new FileInputWidget();
     parent::__construct($dict);
 }
コード例 #2
0
ファイル: ModelChoiceField.php プロジェクト: johsbk/penguin
 public function __construct($dict = array())
 {
     if (!isset($dict['queryset'])) {
         throw new FormException('No queryset provided.');
     }
     $this->widget = new SelectWidget();
     $this->choices = array_map(function ($item) {
         return array($item->id, $item->__toString());
     }, $dict['queryset']->toArray());
     parent::__construct($dict);
 }
コード例 #3
0
ファイル: HiddenField.php プロジェクト: johsbk/penguin
 public function __construct($dict = array())
 {
     $this->widget = new HiddenInputWidget();
     parent::__construct($dict);
 }