public function __construct(Prototyped $subject) { $this->subject = $subject; $this->map = MappedForm::create($this->subject->proto()->makeForm())->addSource('id', RequestType::get())->setDefaultType(RequestType::post()); $this->setMethodMapping('drop', 'doDrop')->setMethodMapping('take', 'doTake')->setMethodMapping('save', 'doSave')->setMethodMapping('edit', 'doEdit')->setMethodMapping('add', 'doAdd'); $this->setDefaultAction('edit'); }
public function __construct(Prototyped $subject) { $this->subject = $subject; $form = $this->subject->proto()->makeForm()->add(Primitive::choice('action')->setList($this->commandMap)->setDefault($this->defaultAction)); if ($this->idFieldName) { $form->add(Primitive::alias($this->idFieldName, $form->get('id'))); } $this->map = MappedForm::create($form)->addSource('id', RequestType::get())->addSource('action', RequestType::get())->setDefaultType(RequestType::post()); if ($this->idFieldName) { $this->map->addSource($this->idFieldName, RequestType::get()); } }
public function __construct() { $this->requestType = RequestType::post(); }
public function getByType(RequestType $type) { return $this->{$type->getName()}; }
public function __construct() { $this->mav = ModelAndView::create()->setModel(Model::create()); $this->defaultRequestType = RequestType::post(); }