1. Go to this page and download the library: Download robwdwd/svg-icon-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Robwdwd\SVGIconBundle\SVGIcon;
class HomeController extends AbstractController
{
/**
* @Route("/", name="homepage")
*/
public function homepage(SVGIcon $svgIcon) {
// Load the SVG
$svgIcon->loadSVG('mdi', 'magnify', ['class' => 'svgicon'], ['fill' => 'currentColor']);
// Get HTML for SVG
$searchIcon = $svgIcon->toXMLString();
// HTML with XML header
dump($svgIcon->toXMLString(true));
return $this->render('index.html.twig', ['search_icon' => $searchIcon]);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.