ODTDataHandler::encodeTextForODT PHP Méthode

encodeTextForODT() public static méthode

Wrapper function to consistently encode text where appropriate for template functionality
public static encodeTextForODT ( $text ) : string
$text
Résultat string
    public static function encodeTextForODT($text)
    {
        if (is_string($text)) {
            return htmlspecialchars($text, ENT_XML1);
        }
        return $text;
    }

Usage Example

Exemple #1
0
 public function __construct($name, $data = null)
 {
     $this->data['element-type'] = 'simple-text';
     $this->data['name'] = $name;
     if ($data !== null) {
         $this->data['data'] = ODTDataHandler::encodeTextForODT($data);
     }
 }
All Usage Examples Of ODTDataHandler::encodeTextForODT