====== SVG ====== ===== Renderowanie obrazka SVG ===== Dynamiczne renderowanie pliku SVG w kontrolerze i wysłanie go jako obrazka do tagu IMG public function actionSvg($id, $ids) { $elementy = Model::find() ->where(['id' => $id]) ->andWhere(['data' => $ids]) ->all(); $cont = ''; $cont.= $this->renderPartial('svg', [ 'id' => $id, 'model' => $elementy, ]); $response = Yii::$app->getResponse(); $response->headers->set('Content-Type', 'image/svg+xml'); $response->format = \yii\web\Response::FORMAT_RAW; $response->content= $cont; $response->send(); } Widok svg.php generuje dynamicznie strukturę pliku svg xml .... W dowolnym widoku: ===== HTML wewnątrz SVG ===== Przykład HTML inside SVG
I'm a div inside a SVG.