예제 #1
0
 /**
  * buildInput
  *
  * @param array $attrs
  *
  * @return  string
  */
 public function buildInput($attrs)
 {
     // Convert timezone
     $from = $this->get('from', 'UTC');
     $to = $this->get('to', Ioc::getConfig()->get('system.timezone', 'UTC'));
     if ($attrs['value'] && $attrs['value'] != static::EMPTY_DATETIME) {
         $attrs['value'] = DateTime::convert($attrs['value'], $from, $to);
     }
     $input = parent::buildInput($attrs);
     $format = $this->get('format', 'YYYY-MM-DD HH:mm:ss');
     $id = $this->getId();
     return WidgetHelper::render('phoenix.form.field.calendar', array('id' => $id, 'input' => $input, 'attrs' => $attrs, 'format' => $format, 'field' => $this), WidgetHelper::EDGE);
 }
예제 #2
0
 /**
  * buildInput
  *
  * @param array $attrs
  *
  * @return  string
  */
 public function buildInput($attrs)
 {
     $this->prepareScript();
     $this->package = $this->package ?: $this->get('package');
     $this->view = $this->view ?: $this->get('view');
     $attribs = $attrs;
     /** @var HtmlElement $input */
     $input = parent::buildInput($attribs);
     $input['type'] = 'hidden';
     $input['data-value-store'] = true;
     $url = $this->get('url') ?: $this->getUrl();
     $id = $this->getId();
     return WidgetHelper::render('phoenix.form.field.modal', array('id' => $id, 'title' => $this->getTitle(), 'input' => $input, 'url' => $url, 'attrs' => $attrs, 'field' => $this), WidgetHelper::EDGE);
 }