Strings
in package
Table of Contents
- camel2underscores() : string
- Turns camelCased strings into under_scored strings. This is specially useful for class to URL conversion and the other way around.
- ellipsis() : mixed
- endsWith() : mixed
- escape() : type
- This method allows your application to safely print HTML to the output buffer without having to worry about potential HTML injections.
- indent() : string
- Offsets the line by a character. For example, when you're printing text to HTML you wish it to be indented the same way as the rest of your HTML
- plural() : mixed
- quote() : mixed
- singular() : mixed
- slug() : mixed
- startsWith() : mixed
- strToHTML() : type
- underscores2camel() : string
- Converts under_score separated strings into camelCased. Allowing an application to retrieve a class name from a case insensitive environment.
- urls() : mixed
Methods
camel2underscores()
Turns camelCased strings into under_scored strings. This is specially useful for class to URL conversion and the other way around.
public
static camel2underscores(string $str) : string
Parameters
- $str : string
Return values
string —ellipsis()
public
static ellipsis(mixed $str, mixed $targetlength[, mixed $char = '…' ]) : mixed
Parameters
- $str : mixed
- $targetlength : mixed
- $char : mixed = '…'
Return values
mixed —endsWith()
public
static endsWith(mixed $haystack, mixed $needle) : mixed
Parameters
- $haystack : mixed
- $needle : mixed
Return values
mixed —escape()
This method allows your application to safely print HTML to the output buffer without having to worry about potential HTML injections.
public
static escape(type $str) : type
Please note though, that this method does not protect your application from executing javascript if the output is used in the wrong location.
Parameters
- $str : type
Return values
type —indent()
Offsets the line by a character. For example, when you're printing text to HTML you wish it to be indented the same way as the rest of your HTML
public
static indent(string $str[, int $times = 1 ][, string $character = " " ]) : string
Parameters
- $str : string
- $times : int = 1
- $character : string = " "
Return values
string —plural()
public
static plural(mixed $string) : mixed
Parameters
- $string : mixed
Return values
mixed —quote()
public
static quote(mixed $str) : mixed
Parameters
- $str : mixed
Return values
mixed —singular()
public
static singular(mixed $string) : mixed
Parameters
- $string : mixed
Return values
mixed —slug()
public
static slug(mixed $string) : mixed
Parameters
- $string : mixed
Return values
mixed —startsWith()
public
static startsWith(mixed $haystack, mixed $needle) : mixed
Parameters
- $haystack : mixed
- $needle : mixed
Return values
mixed —strToHTML()
public
static strToHTML(type $str) : type
Parameters
- $str : type
Tags
Return values
type —underscores2camel()
Converts under_score separated strings into camelCased. Allowing an application to retrieve a class name from a case insensitive environment.
public
static underscores2camel(string $str[, bool $high = true ]) : string
Parameters
- $str : string
-
The input string (example: camel_case)
- $high : bool = true
-
Defines whether the first letter should be uppercase. "CamelCase" (true) or "camelCase" (false)
Return values
string —urls()
public
static urls(mixed $str[, mixed $cb = null ]) : mixed
Parameters
- $str : mixed
- $cb : mixed = null