PHP code example of slashworks / contao-simple-svg-icons-bundle
1. Go to this page and download the library: Download slashworks/contao-simple-svg-icons-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/ */
slashworks / contao-simple-svg-icons-bundle example snippets
use \Slashworks\ContaoSimpleSvgIconsBundle\DataContainer\General;
$GLOBALS['TL_DCA']['tl_content']['fields']['myIcon'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_content']['icon'],
'inputType' => 'svgiconselect', // This field uses the custom backend widget
'options_callback' => array(General::class, 'getIcons'), // Get all svg icons selected in the themes.
'reference' => &$GLOBALS['TL_LANG']['MSC']['icons'], // Use the symbols ID as key for a translation.
'eval' => array('
$GLOBALS['TL_LANG']['MSC']['icons']['icon-arrow-right'] = 'Pfeil nach rechts';
$GLOBALS['TL_LANG']['MSC']['icons']['icon-arrow-left'] = 'Pfeil nach links';