diff options
| author | polo <ordipolo@gmx.fr> | 2025-11-01 17:54:22 +0100 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-11-01 17:54:22 +0100 |
| commit | 46d3c239a7ad2b00e86373f2fd0e829fdcba57f7 (patch) | |
| tree | 054d8e5d3c43bcfc587bb5308e6d2a444eec54bf /src/view/AbstractBuilder.php | |
| parent | f33135c5d36d0e747d07773919ae0bc84cbceac1 (diff) | |
| download | cms-46d3c239a7ad2b00e86373f2fd0e829fdcba57f7.tar.gz cms-46d3c239a7ad2b00e86373f2fd0e829fdcba57f7.tar.bz2 cms-46d3c239a7ad2b00e86373f2fd0e829fdcba57f7.zip | |
utilisation des icônes SVG du dépôt twbs/bootstrap-icons pour les réseaux sociaux, amélioration du CSS
Diffstat (limited to 'src/view/AbstractBuilder.php')
| -rw-r--r-- | src/view/AbstractBuilder.php | 17 |
1 files changed, 17 insertions, 0 deletions
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 | |||
| 57 | { | 57 | { |
| 58 | $this->html .= $html; | 58 | $this->html .= $html; |
| 59 | } | 59 | } |
| 60 | |||
| 61 | protected function insertSVG(string $path, array $attributes = []): string | ||
| 62 | { | ||
| 63 | $svg = file_get_contents($path); | ||
| 64 | |||
| 65 | // modification des attributs | ||
| 66 | if(!empty($attributes)){ | ||
| 67 | $dom = new DOMDocument(); | ||
| 68 | $dom->loadXML($svg); | ||
| 69 | $svg_elem = $dom->documentElement; | ||
| 70 | foreach($attributes as $key => $value){ | ||
| 71 | $svg_elem->setAttribute($key, $value); | ||
| 72 | } | ||
| 73 | $svg = $dom->saveXML($svg_elem); | ||
| 74 | } | ||
| 75 | return $svg; | ||
| 76 | } | ||
| 60 | } \ No newline at end of file | 77 | } \ No newline at end of file |
