Create a custom Twig filter in Drupal 8
Create hello_world folder in modules/custom/ folder with the following files, 1. hello_world.services.yml // It would contain following lines, services: hello_world.twig_extension: arguments: [‘@renderer’] class: Drupal\hello_world\TwigExtension\RemoveNumbers tags: – { name: twig.extension } 2. src/TwigExtension/RemoveNumbers.php It would contain followings in that: namespace Drupal\hello_world\TwigExtension; class RemoveNumbers extends \Twig_Extension { /** * Generates a list of all Twig filters that…