mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Snippet to include id attribute.
This commit is contained in:
@@ -2441,7 +2441,7 @@ class e_form
|
|||||||
|
|
||||||
private function renderSnippet($snippet, $options, $name, $value)
|
private function renderSnippet($snippet, $options, $name, $value)
|
||||||
{
|
{
|
||||||
$snip = $options;
|
$snip = (array) $options;
|
||||||
|
|
||||||
if(!empty($options['class']))
|
if(!empty($options['class']))
|
||||||
{
|
{
|
||||||
@@ -2449,6 +2449,8 @@ class e_form
|
|||||||
unset($options['class']);
|
unset($options['class']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$snip['id'] = $this->_format_id(varset($options['id']), $name, $value, null);
|
||||||
|
unset($options['id']);
|
||||||
$snip['attributes'] = $this->get_attributes($options, $name, $value);
|
$snip['attributes'] = $this->get_attributes($options, $name, $value);
|
||||||
|
|
||||||
foreach($snip as $k=>$v)
|
foreach($snip as $k=>$v)
|
||||||
|
@@ -1148,7 +1148,7 @@ class e_formTest extends \Codeception\Test\Unit
|
|||||||
|
|
||||||
$result = $this->_frm->checkbox('myname', 3, true, ['readonly'=>true]);
|
$result = $this->_frm->checkbox('myname', 3, true, ['readonly'=>true]);
|
||||||
$expected = "<label class='checkbox form-check'>
|
$expected = "<label class='checkbox form-check'>
|
||||||
<input class='form-check-input' type='checkbox' id='myname-3' readonly='readonly' checked='checked' />
|
<input id='myname-3' class='form-check-input' type='checkbox' readonly='readonly' checked='checked' />
|
||||||
<span></span>
|
<span></span>
|
||||||
</label>";
|
</label>";
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<label class='checkbox form-check'>
|
<label class='checkbox form-check'>
|
||||||
<input class='{class}' type='checkbox' {attributes} />
|
<input id='{id}' class='{class}' type='checkbox' {attributes} />
|
||||||
<span>{label}</span>
|
<span>{label}</span>
|
||||||
</label>
|
</label>
|
Reference in New Issue
Block a user