Exemplo n.º 1
0
 /**
  * 2015-11-17
  * @param string $name
  * @param string|null|Phrase $label [optional]
  * @param array(string => mixed)|bool|string $value [optional]
  * @param string|null $note [optional]
  * @return \Magento\Framework\Data\Form\Element\Checkbox|E
  */
 protected function checkbox($name, $label = null, $value = null, $note = null)
 {
     $data = is_array($value) ? $value + ['note' => $note] : (is_bool($value) ? ['checked' => $value, 'note' => $note] : ['note' => $value]);
     return $this->field($name, Checkbox::class, $label, ['checked' => Checkbox::b($this->v($name), df_bool(dfa($data, 'checked')))] + $data);
 }
Exemplo n.º 2
0
Arquivo: O.php Projeto: mage2pro/core
 /**
  * 2015-12-30
  * @param bool|callable $d [optional]
  * @param string|null $k [optional]
  * @return bool
  */
 protected function b($d = false, $k = null)
 {
     return $this->filter(function ($v) use($d) {
         return Checkbox::b($v, $d);
     }, $d, $k);
 }