Untitled

 avatar
unknown
plain_text
2 years ago
1.0 kB
4
Indexable

                            $html = '';
                            if (isset($input['img'])) {
                                $path = \yii::getAlias('@web' . $input['img']);

                                $content = file_get_contents($path);

                                $input['img'] = 'data:image/' . pathinfo($path, \PATHINFO_EXTENSION) . ';base64,' . base64_encode($content);

                                $html = '<div style="' . $debug . 'width:' . $width . ';height:' . $maxHeight . ';text-align:center;background:' . $background . ';font-size:' . $fontSize . 'px;position:absolute;left:' . $left . ';top:' . $top . '"><img style="width:100%;" src="' . $input['img'] . '"/></div>';
                            } else {
                                $html = '<div style="' . $debug . 'width:' . $width . ';font-size:' . $fontSize . ';text-align:' . $textAlign . ';background:' . $background . ';position:absolute;left:' . $left . ';top:' . $top . '">' . $input['text'] . '</div>';
                            }
Editor is loading...