Skip to content

Commit 6c03876

Browse files
committed
Revert "addText(), addPassword() and addTextArea() deprecated third parameter $cols (and $rows) (BC break!)"
This reverts commit f5f00a2.
1 parent 62614f3 commit 6c03876

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

src/Forms/Container.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,7 @@ public function getForm($need = TRUE)
238238
public function addText($name, $label = NULL, $cols = NULL, $maxLength = NULL)
239239
{
240240
$control = new Controls\TextInput($label, $maxLength);
241-
if ($cols) {
242-
trigger_error(__METHOD__ . '() third parameter $cols is deprecated, use setAttribute("size", ...).', E_USER_DEPRECATED);
243-
$control->setAttribute('size', $cols);
244-
}
241+
$control->setAttribute('size', $cols);
245242
return $this[$name] = $control;
246243
}
247244

@@ -257,10 +254,7 @@ public function addText($name, $label = NULL, $cols = NULL, $maxLength = NULL)
257254
public function addPassword($name, $label = NULL, $cols = NULL, $maxLength = NULL)
258255
{
259256
$control = new Controls\TextInput($label, $maxLength);
260-
if ($cols) {
261-
trigger_error(__METHOD__ . '() third parameter $cols is deprecated, use setAttribute("size", ...).', E_USER_DEPRECATED);
262-
$control->setAttribute('size', $cols);
263-
}
257+
$control->setAttribute('size', $cols);
264258
return $this[$name] = $control->setType('password');
265259
}
266260

@@ -276,11 +270,8 @@ public function addPassword($name, $label = NULL, $cols = NULL, $maxLength = NUL
276270
public function addTextArea($name, $label = NULL, $cols = NULL, $rows = NULL)
277271
{
278272
$control = new Controls\TextArea($label);
279-
if ($cols) {
280-
trigger_error(__METHOD__ . '() parameters $cols is deprecated, use setAttribute("cols", ...).', E_USER_DEPRECATED);
281-
$control->setAttribute('cols', $cols);
282-
}
283-
return $this[$name] = $control->setAttribute('rows', $rows);
273+
$control->setAttribute('cols', $cols)->setAttribute('rows', $rows);
274+
return $this[$name] = $control;
284275
}
285276

286277

tests/Forms.Latte/expected/FormMacros.forms.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
<input type="hidden" name="id" value="" title="Hello" size="10">
1010

1111
<label for="frm-username">Username:</label>
12-
<input type="text" name="username" id="frm-username" title="Hello" size="10">
12+
<input type="text" name="username" size="10" id="frm-username" title="Hello">
1313
error
1414
error
1515

1616
<br>
1717

18-
<label for="frm-username" title="hello"> <input type="text" name="username" id="frm-username" title="Hello" size="10"> </label>
18+
<label for="frm-username" title="hello"> <input type="text" name="username" size="10" id="frm-username" title="Hello"> </label>
1919
error
2020
<label for="frm-select"></label>
2121
<select name="select" id="frm-select" title="Hello" size="10"><option value="m">male</option><option value="f">female</option></select>

0 commit comments

Comments
 (0)