From 46d3c239a7ad2b00e86373f2fd0e829fdcba57f7 Mon Sep 17 00:00:00 2001 From: polo Date: Sat, 1 Nov 2025 17:54:22 +0100 Subject: =?UTF-8?q?utilisation=20des=20ic=C3=B4nes=20SVG=20=20du=20d=C3=A9?= =?UTF-8?q?p=C3=B4t=20twbs/bootstrap-icons=20pour=20les=20r=C3=A9seaux=20s?= =?UTF-8?q?ociaux,=20am=C3=A9lioration=20du=20CSS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/AbstractBuilder.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/view/AbstractBuilder.php') diff --git a/src/view/AbstractBuilder.php b/src/view/AbstractBuilder.php index 3d315b1..b9a1d7f 100644 --- a/src/view/AbstractBuilder.php +++ b/src/view/AbstractBuilder.php @@ -57,4 +57,21 @@ abstract class AbstractBuilder { $this->html .= $html; } + + protected function insertSVG(string $path, array $attributes = []): string + { + $svg = file_get_contents($path); + + // modification des attributs + if(!empty($attributes)){ + $dom = new DOMDocument(); + $dom->loadXML($svg); + $svg_elem = $dom->documentElement; + foreach($attributes as $key => $value){ + $svg_elem->setAttribute($key, $value); + } + $svg = $dom->saveXML($svg_elem); + } + return $svg; + } } \ No newline at end of file -- cgit v1.2.3