nortmas
9/27/2017 - 4:42 PM

Functions

<?php
// Performs format=flowed soft wrapping for mail (RFC 3676).
MailFormatHelper::wrapMail($text);
// Filter external values
Xss::filter($value);
// Escapes text by converting special characters to HTML entities.
Html::escape($title);
// Double-escaped entities will only be decoded once
Html::decodeEntities($str);
//Normalizes an HTML snippet
Html::normalize($str);
// Prepares a string for use as a valid HTML ID.
Html::getId('test string with spaces'); // test-string-with-space
// Returns a URL-safe, base64 encoded string of highly randomized bytes.
Crypt::randomBytesBase64(55);
// Generates a random string containing letters and numbers.
$random = new Random();
$key = $random->name();
// create url
file_create_url($uri);
// A safe string filtered with the allowed tag list and normalized.
$title = Markup::create($title);
// generates a string based on given renderd attributes element.
new Attribute($element['#attributes']);
// Identifies the children of an element array, optionally sorted by weight.
Element::children(array &$elements, $sort = FALSE)
// Truncates a UTF-8-encoded string safely to a number of characters.
Unicode::truncate($string, $max_length, $wordsafe = FALSE, $add_ellipsis = FALSE, $min_wordsafe_length = 1)
// Generates a trimmed, formatted version of a text field value.
text_summary($text, $format = NULL, $size = NULL)
// Runs all the enabled filters on a piece of text.
check_markup($text, $format_id = NULL, $langcode = '', $filter_types_to_skip = [])
// Filter array and leave only elements with numeric keys.
array_filter($questions, 'is_numeric', ARRAY_FILTER_USE_KEY)