Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.0 kB
1
Indexable
Never

                            $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>';
                            }