1 | <?php |
||
28 | class Point extends Type implements ArrayableInterface |
||
29 | { |
||
30 | /** |
||
31 | * @var float x coordinate |
||
32 | */ |
||
33 | public $x; |
||
34 | /** |
||
35 | * @var float y coordinate |
||
36 | */ |
||
37 | public $y; |
||
38 | /** |
||
39 | * @var bool if round is set to true, LetLeaf will round the x and y values. |
||
40 | */ |
||
41 | public $round = false; |
||
42 | |||
43 | /** |
||
44 | * Initializes the class |
||
45 | * @throws \yii\base\InvalidConfigException |
||
46 | */ |
||
47 | 12 | public function init() |
|
53 | |||
54 | /** |
||
55 | * @return \yii\web\JsExpression the js initialization code of the object |
||
56 | */ |
||
57 | 3 | public function encode() |
|
63 | |||
64 | /** |
||
65 | * Returns the point values as array |
||
66 | * |
||
67 | * @param bool $encode whether to return the array json_encoded or raw |
||
68 | * |
||
69 | * @return array|JsExpression |
||
70 | */ |
||
71 | 12 | public function toArray($encode = false) |
|
76 | } |
||
77 |