defaultFormat() public static method

Return the default input formatter.
public static defaultFormat ( boolean | null $is_mobile = null ) : string
$is_mobile boolean | null Whether or not you want the format for mobile browsers.
return string
示例#1
0
 /**
  * A special text box for formattable text.
  *
  * Formatting plugins like ButtonBar will auto-attach to this element.
  *
  * @param string $Column
  * @param array $Attributes
  * @since 2.1
  * @return string HTML element.
  */
 public function bodyBox($Column = 'Body', $Attributes = array())
 {
     touchValue('MultiLine', $Attributes, true);
     touchValue('Wrap', $Attributes, true);
     touchValue('class', $Attributes, '');
     $Attributes['class'] .= ' TextBox BodyBox';
     $this->setValue('Format', val('Format', $Attributes, $this->getValue('Format', Gdn_Format::defaultFormat())));
     $Result = '<div class="bodybox-wrap">';
     // BeforeBodyBox
     $this->EventArguments['Table'] = val('Table', $Attributes);
     $this->EventArguments['Column'] = $Column;
     $this->EventArguments['Attributes'] = $Attributes;
     $this->EventArguments['BodyBox'] =& $Result;
     $this->fireEvent('BeforeBodyBox');
     // Only add the format if it was set on the form. This allows plugins to remove the format.
     if ($format = $this->getValue('Format')) {
         $Attributes['format'] = htmlspecialchars($format);
         $this->setValue('Format', $Attributes['format']);
         $Result .= $this->hidden('Format');
     }
     $Result .= $this->textBox($Column, $Attributes);
     $Result .= '</div>';
     return $Result;
 }