| | 22 | * Bind to parameters from the symfony request object, based on name format. |
|---|
| | 23 | * |
|---|
| | 24 | * @throws LogicException If the name format is not recognized |
|---|
| | 25 | */ |
|---|
| | 26 | public function bindToRequest() |
|---|
| | 27 | { |
|---|
| | 28 | $request = sfContext::getInstance()->getRequest(); |
|---|
| | 29 | |
|---|
| | 30 | if ('%s' == $nameFormat = $this->widgetSchema->getNameFormat()) |
|---|
| | 31 | { |
|---|
| | 32 | $this->bind($request->isMethod('post') ? $request->getPostParameters() : $request->getGetParameters(), $request->getFiles()); |
|---|
| | 33 | } |
|---|
| | 34 | elseif ('[%s]' == substr($nameFormat, -4)) |
|---|
| | 35 | { |
|---|
| | 36 | $this->bind($request->getParameter(substr($nameFormat, 0, -4)), $request->getFiles()); |
|---|
| | 37 | } |
|---|
| | 38 | else |
|---|
| | 39 | { |
|---|
| | 40 | throw new LogicException(sprintf('%s cannot understand the name format "%s"', __METHOD__, $nameFormat)); |
|---|
| | 41 | } |
|---|
| | 42 | } |
|---|
| | 43 | |
|---|
| | 44 | /** |
|---|