PHP code example of phildaiguille / twig-a11y-rules
1. Go to this page and download the library: Download phildaiguille/twig-a11y-rules 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/ */
phildaiguille / twig-a11y-rules example snippets
use TwigCsFixer\Config\Config;
use TwigA11y\Rules\Media\ImgAltRule;
use TwigA11y\Rules\Structure\BannedTagsRule;
$config = new Config();
// getRuleset() keeps the default twig-cs-fixer standard in place.
$config->getRuleset()
->addRule(new ImgAltRule())
->addRule(new BannedTagsRule());
return $config;
use TwigA11y\Standard\A11yStandard;
use TwigCsFixer\Config\Config;
$config = new Config();
$config->getRuleset()->addStandard(new A11yStandard());
$config->allowNonFixableRules(true);
return $config;