Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
checkbox.php
1<?php
3
5{
14 public function viewForm(array $params = array())
15 {
16 $name = \htmlspecialcharsbx(isset($params['name_format'])
17 ? str_replace('#field_code#', $this->code, $params['name_format'])
18 : $this->code);
19 ?>
20 <input type="hidden" name="<?= $name?>" value="N" />
21 <input type="checkbox" <?
22 ?><?= isset($params['additional']) ? $params['additional'] . ' ' : ''?><?
23 ?><?= isset($params['id']) ? 'id="' . \htmlspecialcharsbx($params['id']) . '" ' : ''?><?
24 ?>class="<?= isset($params['class']) ? \htmlspecialcharsbx($params['class']) : ''?>" <?
25 ?>data-code="<?= \htmlspecialcharsbx($this->code)?>" <?
26 ?>name="<?= $name?>" <?
27 ?><?= (isset($params['disabled']) && $params['disabled']) ? ' disabled ' : ''?><?
28 ?>value="Y"<?if ($this->value == 'Y'){?> checked="checked"<?}?> <?
29 ?> />
30 <?
31 }
32
37 public function isEmptyValue()
38 {
39 return $this->value !== 'Y';
40 }
41
46 public function __toString()
47 {
48 return $this->value == 'Y' ? 'Y' : 'N';
49 }
50}
viewForm(array $params=array())
Definition checkbox.php:14