1 | <?php |
||
22 | class JsHelper |
||
23 | { |
||
24 | /** |
||
25 | * initVar function. |
||
26 | * |
||
27 | * @param string $name |
||
28 | * @param object|string $value . Object type: \yii\web\JsExpression |
||
29 | * |
||
30 | * @return string |
||
31 | */ |
||
32 | 6 | public static function initVar($name, $value) |
|
33 | { |
||
34 | 6 | return "var {$name} = {$value}"; |
|
35 | } |
||
36 | |||
37 | /** |
||
38 | * addString function. |
||
39 | * |
||
40 | * @param string $value |
||
41 | * |
||
42 | * @return string |
||
43 | */ |
||
44 | 6 | public static function addString($value) |
|
48 | |||
49 | /** |
||
50 | * newJsObject function. |
||
51 | * |
||
52 | * @param string $instanceName |
||
53 | * @param array $params |
||
54 | * |
||
55 | * @return string \yii\web\JsExpression. See https://www.yiiframework.com/doc/api/2.0/yii-web-jsexpression for more information about it. |
||
56 | */ |
||
57 | 6 | public static function newJsObject($instanceName, $params = []) |
|
63 | } |
||
64 |