helpers\BaseStringHelper byteLength()

byteLength() public static method Returns the number of bytes in the given string. This method ensures the string is treated as a byte array by using mb_strlen(). public static integer byteLength ( $string )$string string The string being measured for length return integer The number of bytes in the given string.

helpers\BaseStringHelper basename()

basename() public static method Returns the trailing name component of a path. This method is similar to the php function basename() except that it will treat both \ and / as directory separators, independent of the operating system. This method was mainly created to work on php namespaces. When working with real file paths, php's basename() should work fine for you. Note: this method is not aware of the actual filesystem, or path components such as "..". See also http://www.php.net/manual/

helpers\BaseMarkdown processParagraph()

processParagraph() public static method Converts markdown into HTML but only parses inline elements. This can be useful for parsing small comments or description lines. public static string processParagraph ( $markdown, $flavor = null )$markdown string The markdown text to parse $flavor string The markdown flavor to use. See $flavors for available values. Defaults to $defaultFlavor, if not set. return string The parsed HTML output throws yii\base\InvalidParamException when an undef

helpers\BaseMarkdown process()

process() public static method Converts markdown into HTML. public static string process ( $markdown, $flavor = null )$markdown string The markdown text to parse $flavor string The markdown flavor to use. See $flavors for available values. Defaults to $defaultFlavor, if not set. return string The parsed HTML output throws yii\base\InvalidParamException when an undefined flavor is given.

helpers\BaseMarkdown getParser()

getParser() protected static method protected static \cebe\markdown\Parser getParser ( $flavor )$flavor string The markdown flavor to use. See $flavors for available values. Defaults to $defaultFlavor, if not set. throws yii\base\InvalidParamException when an undefined flavor is given.

helpers\BaseMarkdown $flavors

$flavors public static property A map of markdown flavor names to corresponding parser class configurations. public static array $flavors = ['original' => ['class' => 'cebe\markdown\Markdown', 'html5' => true], 'gfm' => ['class' => 'cebe\markdown\GithubMarkdown', 'html5' => true], 'gfm-comment' => ['class' => 'cebe\markdown\GithubMarkdown', 'html5' => true, 'enableNewlines' => true], 'extra' => ['class' => 'cebe\markdown\MarkdownExtra', 'html5' => tru

helpers\BaseMarkdown $defaultFlavor

$defaultFlavor public static property The markdown flavor to use when none is specified explicitly. Defaults to original. See also $flavors. public static string $defaultFlavor = 'original'

helpers\BaseJson processData()

processData() protected static method Pre-processes the data before sending it to json_encode(). protected static mixed processData ( $data, &$expressions, $expPrefix )$data mixed The data to be processed $expressions array Collection of JavaScript expressions $expPrefix string A prefix internally used to handle JS expressions return mixed The processed data

helpers\BaseJson htmlEncode()

htmlEncode() public static method (available since version 2.0.4) Encodes the given value into a JSON string HTML-escaping entities so it is safe to be embedded in HTML code. The method enhances json_encode() by supporting JavaScript expressions. In particular, the method will not encode a JavaScript expression that is represented in terms of a yii\web\JsExpression object. public static string htmlEncode ( $value )$value mixed The data to be encoded return string The encoding result t

helpers\BaseJson handleJsonError()

handleJsonError() protected static method (available since version 2.0.6) Handles encode() and decode() errors by throwing exceptions with the respective error message. protected static void handleJsonError ( $lastError )$lastError integer Error code from json_last_error(). throws yii\base\InvalidParamException if there is any encoding/decoding error.