cocur / slugify

Converts a string to a slug. Includes integrations for Symfony, Silex, Laravel, Zend Framework 2, Twig, Nette and Latte.
MIT License
2.87k stars 251 forks source link

Symfony Bundle ignores ruleset #274

Closed lostfocus closed 3 years ago

lostfocus commented 3 years ago

I'm trying to get the ruleset working for a project running on Symfony 4.4.

The bundle is activated in the bundles.php and my cocur_slugify.yaml looks like this

cocur_slugify:
  lowercase: true
  separator: '-'
  rulesets: ['german']

and when I run bin/console debug:config CocurSlugifyBundle it looks like it get the information:

➜  bin/console debug:config CocurSlugifyBundle

Current configuration for "CocurSlugifyBundle"
==============================================

cocur_slugify:
    lowercase: true
    separator: '-'
    rulesets:
        - german

I then add Slugify to a Service class through the interface:

    private SlugifyInterface $slugify;

    /**
     * @param SlugifyInterface $slugify
     */
    public function __construct(SlugifyInterface $slugify)
    {
        $this->slugify = $slugify;
    }

And then I was hoping that a $this->slugify->slugify('Erläuterungsbroschüre'); would create erlaeuterungsbroschuere- instead I get erla-uterungsbroschu-re - which looks to me like it doesn't use the right ruleset.

What could be the problem here?

lostfocus commented 3 years ago

Okay, the problem isn't Symfony. I close this ticket and try to formulate one for the real problem that just occurred here.