Contao\FormTextField::generate PHP Метод

generate() публичный Метод

Generate the widget and return it as string
public generate ( ) : string
Результат string The widget markup
    public function generate()
    {
        return sprintf('<input type="%s" name="%s" id="ctrl_%s" class="text%s%s" value="%s"%s%s', $this->type, $this->strName, $this->strId, $this->hideInput ? ' password' : '', $this->strClass != '' ? ' ' . $this->strClass : '', \StringUtil::specialchars($this->value), $this->getAttributes(), $this->strTagEnding);
    }

Usage Example

 /**
  * Generate the widget and return it as string
  *
  * @return string The widget markup
  */
 public function generate()
 {
     $this->bindDateTimePickerFileAndScript();
     $template = new FrontendTemplate('form_bootstrap_calendar_field');
     $template->input = parent::generate();
     $template->id = $this->id;
     $template->icon = $this->bsDateImage;
     $template->name = $this->name;
     return $template->parse();
 }