DS
DS = DIRECTORY_SEPARATOR
Define DS as short form of DIRECTORY_SEPARATOR.
CakePHP(tm) : Rapid Development Framework (https://cakephp.org) Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
Licensed under The MIT License For full copyright and license information, please see the LICENSE.txt Redistributions of files must retain the above copyright notice.
h(mixed $text, boolean $double = true, string|null $charset = null) : mixed
Convenience method for htmlspecialchars.
mixed | $text | Text to wrap through htmlspecialchars. Also works with arrays, and objects.
Arrays will be mapped and have all their elements escaped. Objects will be string cast if they
implement a |
boolean | $double | Encode existing html entities. |
string|null | $charset | Character set to use when escaping. Defaults to config value in |
Wrapped text.
pluginSplit(string $name, boolean $dotAppend = false, string|null $plugin = null) : array
Splits a dot syntax plugin name into its plugin and class name.
If $name does not have a dot, then index 0 will be null.
Commonly used like
list($plugin, $name) = pluginSplit($name);
string | $name | The name you want to plugin split. |
boolean | $dotAppend | Set to true if you want the plugin to have a '.' appended to it. |
string|null | $plugin | Optional default plugin to use if no plugin is found. Defaults to null. |
Array with 2 indexes. 0 => plugin name, 1 => class name.
namespaceSplit(string $class) : array
Split the namespace from the classname.
Commonly used like list($namespace, $className) = namespaceSplit($class);
.
string | $class | The full class name, ie |
Array with 2 indexes. 0 => namespace, 1 => classname.
pr(mixed $var) : mixed
print_r() convenience function.
In terminals this will act similar to using print_r() directly, when not run on cli print_r() will also wrap
tags around the output of given variable. Similar to debug().This function returns the same variable that was passed.
Parameters
mixed | $var | Variable to print out. |
the same $var that was passed to this function
pj(mixed $var) : mixed
json pretty print convenience function.
In terminals this will act similar to using json_encode() with JSON_PRETTY_PRINT directly, when not run on cli will also wrap
tags around the output of given variable. Similar to pr().This function returns the same variable that was passed.
Parameters
mixed | $var | Variable to print out. |
the same $var that was passed to this function
env(string $key, string|null $default = null) : string|boolean|null
Gets an environment variable from available sources, and provides emulation for unsupported or inconsistent environment variables (i.e. DOCUMENT_ROOT on IIS, or SCRIPT_NAME in CGI mode). Also exposes some additional custom environment information.
string | $key | Environment variable name. |
string|null | $default | Specify a default value in case the environment variable is not defined. |
Environment variable setting.
deprecationWarning(string $message, integer $stackFrame = 1) : void
Helper method for outputting deprecation warnings
string | $message | The message to output as a deprecation warning. |
integer | $stackFrame | The stack frame to include in the error. Defaults to 1 as that should point to application/plugin code. |
Loading…