method label documentation in bbn\Html\Builder

function($cfg) { if ( isset($cfg['null']) && $cfg['null'] ){ $label = [ 'tag' => 'div', 'attr' => [ 'class' => self::$label_class ], 'content' => [] ]; $tmp = [ 'tag' => 'label', 'text' => isset($cfg['label']) ? $cfg['label'] : ' ' ]; if ( isset($cfg['attr']['id']) ){ $tmp['attr'] = [ 'for' => $cfg['attr']['id'] ]; } array_push($label['content'], $tmp); $label_content = [ 'tag' => 'div', 'css' => [ 'display' => 'block', 'position' => 'absolute', 'right' => '0px', 'top' => '3px' ], 'content' => [ [ 'tag' => 'span', 'text' => 'Null? ' ], [ 'tag' => 'input', 'attr' => [ 'id' => bbn\Str::genpwd(), 'type' => 'checkbox', ], 'events' => [ 'click' => 'function(e){ $("#'.$cfg['attr']['id'].'").prop("disabled", $(this).is(":checked"));'. ( isset($cfg['widget']['name']) ? ' bbn.fn.log("'.$cfg['widget']['name'].'"); try{ $("#'.$cfg['attr']['id'].'").'.$cfg['widget']['name'].'("enable", (!$(this).is(":checked"))); } catch(err){ bbn.fn.log(err); }' : '' ). ' }' ] ] ] ]; if ( empty($cfg['attr']['value']) ){ $label_content['content'][1]['attr']['checked'] = true; } array_push($label['content'], $label_content); } else{ $label = [ 'tag' => 'label', 'text' => (isset($cfg['label']) ? $cfg['label'] : ' '), 'attr' => [ 'class' => self::$label_class ] ]; if ( isset($cfg['attr']['id']) ){ $label['attr']['for'] = $cfg['attr']['id']; } } return new Element($label); }

BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.