Formats an javascript assignment with proper escaping of a value
and support for assigning array of strings.
public static getJsValue ( string $key, mixed $value, boolean $escape = true ) : string | ||
$key | string | Name of value to set |
$value | mixed | Value to set, can be either string or array of strings |
$escape | boolean | Whether to escape value or keep it as it is (for inclusion of js code) |
Результат | string | Javascript code. |