cookie-consent-bundle icon indicating copy to clipboard operation
cookie-consent-bundle copied to clipboard

Unrecognized option "resource" under "ch_cookie_consent"

Open costash1 opened this issue 3 years ago • 2 comments

Hello, beginner question: I have followed the installation instructions and i get:

Unrecognized option "resource" under "ch_cookie_consent"

I am running Symfony 3.4.49. My app/config/routing.yml has this related entry:

ch_cookie_consent: resource: "@CHCookieConsentBundle/Resources/config/routing.yaml"

Of course if i remove this entry from the config.yml I get:

Unable to generate a URL for the named route "ch_cookie_consent.show" as such route does not exist.

Any help would be appreciated. Thank you.

costash1 avatar Jun 16 '21 15:06 costash1

Same problem here... one year later and nobody replied? How disappointing...

TheAFOGroup avatar Sep 21 '22 10:09 TheAFOGroup

Try to add

ch_cookie_consent:
  resource: "@CHCookieConsentBundle/Resources/config/routing.yaml"

in config/routes.yaml instead of app/config/routing.yml or alternatively in config/routes/ch_cookie_consent.yaml

Now you can test routes by running php bin/console debug:router and you should see the routes :

 -------------------------------------------------- --------------------- -------- ------ ------------------------------------------------
  Name                                               Method                Scheme   Host   Path
 -------------------------------------------------- --------------------- -------- ------ ------------------------------------------------
  ch_cookie_consent.show                             ANY                   ANY      ANY    /cookie_consent
  ch_cookie_consent.show_if_cookie_consent_not_set   ANY                   ANY      ANY    /cookie_consent_alt

webmix avatar Feb 13 '23 11:02 webmix