示例#1
0
 /**
  * @param      $name
  * @param null $container
  *
  * @return ElementTbText
  */
 function add($name, $container = null)
 {
     $method = \Str::studly('add_' . $name);
     if (!$container) {
         $container = $this->form;
     }
     $element = call_user_func([$this, $method], $container);
     /* @var ElementTbText $element */
     $element->toggleFrozen(!$this->isFieldEnabled($name));
     if (!$element->getLabel()) {
         $element->setLabel($this->model->getEntityLabel($name));
     }
     return $element;
 }
示例#2
0
文件: Accessor.php 项目: larakit/lk
 function toArray()
 {
     $ret = [];
     foreach ($this->model->toArray() as $k => $v) {
         $ret[$k] = $this->get($k);
     }
     return $ret;
 }