示例#1
0
文件: Link.php 项目: tuanlq11/cms
 /**
  * @param array $options
  * @param bool  $showLabel
  * @param bool  $showField
  * @param bool  $showError
  *
  * @return string
  */
 public function render(array $options = [], $showLabel = true, $showField = true, $showError = true)
 {
     $options = array_merge($this->getOptions(), $options);
     $options['url'] = array_get($options, 'url', '#');
     $options['label'] = array_get($options, 'label', 'Link');
     $options['attr'] = array_get($options, 'attr', ['class' => '']);
     return parent::render($options, $showLabel, $showField, $showError);
 }
 /**
  * @param array $options
  * @param bool  $showLabel
  * @param bool  $showField
  * @param bool  $showError
  * @return string
  */
 public function render(array $options = [], $showLabel = true, $showField = true, $showError = true)
 {
     $options['mode'] = 'multiple';
     $options['getter_method'] = 'get_nodes_by_ids';
     $options['getter_method_params'] = [false];
     $options['search_route'] = 'reactor.nodes.search.json';
     return parent::render($options, $showLabel, $showField, $showError);
 }
示例#3
0
 /**
  * {@inheritDoc}
  */
 public function render(array $options = [], $showLabel = true, $showField = true, $showError = true)
 {
     if (isset($options['attr']) && is_array($options['attr'])) {
         $options['attr']['class'] = !empty($options['attr']['class']) ? $options['attr']['class'] . ' lavanda-image-upload' : $this->options['attr']['class'] . ' lavanda-image-upload';
     } else {
         $options['attr'] = ['class' => $this->options['attr']['class'] . ' lavanda-image-upload'];
     }
     if ($this->getValue()) {
         $options['rules'] = str_replace(['required|', '|required', 'required'], '', $this->getOption('rules'));
         if (isset($this->options['attr']['required'])) {
             unset($this->options['attr']['required']);
         }
     }
     return parent::render($options, $showLabel, $showField, $showError);
 }
示例#4
0
 /**
  * {@inheritDoc}
  */
 public function render(array $options = [], $showLabel = true, $showField = true, $showError = true)
 {
     $preparedOptions = $this->prepareOptions($options);
     $options['attr']['data-format'] = $preparedOptions['format'];
     return parent::render($options, $showLabel, $showField, $showError);
 }
 /**
  * @param array $options
  * @param bool  $showLabel
  * @param bool  $showField
  * @param bool  $showError
  * @return string
  */
 public function render(array $options = [], $showLabel = true, $showField = true, $showError = true)
 {
     $options['children'] = $this->children;
     return parent::render($options, $showLabel, $showField, $showError);
 }
 function form_errors(FormField $formField, array $options = [])
 {
     return $formField->render($options, false, false, true);
 }