TbHtml::checkBox PHP Method

checkBox() public static method

Generates a check box.
public static checkBox ( string $name, boolean $checked = false, array $htmlOptions = [] ) : string
$name string the input name.
$checked boolean whether the check box is checked.
$htmlOptions array additional HTML attributes.
return string the generated check box.
    public static function checkBox($name, $checked = false, $htmlOptions = array())
    {
        $label = TbArray::popValue('label', $htmlOptions, false);
        $labelOptions = TbArray::popValue('labelOptions', $htmlOptions, array());
        $input = parent::checkBox($name, $checked, $htmlOptions);
        // todo: refactor to make a single call to createCheckBoxAndRadioButtonLabel
        if (TbArray::popValue('useContainer', $htmlOptions, false)) {
            return self::tag('div', array('class' => 'checkbox'), self::createCheckBoxAndRadioButtonLabel($label, $input, $labelOptions));
        } else {
            return self::createCheckBoxAndRadioButtonLabel($label, $input, $labelOptions);
        }
    }

Usage Example

Exemplo n.º 1
0
                                 success:function(data) { $('#detallepractica').html(data).show();}
                           })
                           return false; 
                         }",
                  
                  ),
         ),
    'template' => '{view}',
        ),
    ),
));
  
  ?>

   <div id="detallepractica" class=" oculto bordeada mt30" >
    </div>

<?php

    if ($modelnomenplan->search()->totalItemCount >0 && $controller=='osplan'){  
 echo "<div class='centrado mt30 '>";
//
 echo TbHtml::checkBox('borrarnomenclador', '', array(
    'label' => TbHtml::labelTb('Marcar para borrar el nomenclador', array('color' => TbHtml::LABEL_COLOR_INFO, 'style' => 'padding: 5px ; ')),'Marcar para borrar el nomenclador',
    'style'=>'float:none;'
     )); 
 
 echo "</div>";
    }
   ?> 
All Usage Examples Of TbHtml::checkBox
TbHtml