Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotations rooting not work #89

Open
krombox opened this issue Aug 11, 2016 · 14 comments
Open

Annotations rooting not work #89

krombox opened this issue Aug 11, 2016 · 14 comments
Labels

Comments

@krombox
Copy link

krombox commented Aug 11, 2016

Good day. I am starting to solve one of my tasks with your bundle. It looks easy to use and exactly what i need. I have installed latest version since it has annotation support "besimple/i18n-routing-bundle": "dev-master". Also, i am using Symfony 2.6.*(tried with 3.1.3 too).
Yaml and XML working well, but Annotations not.


use BeSimple\I18nRoutingBundle\Routing\Annotation\I18nRoute;

/**
 * Dashboard controller.
 *
 * @I18nRoute("/")
 */
class DashboardController extends Controller
{
    /**
     * Dashboard index.
     *
     * @I18nRoute("/dashboard", name="dashboard_index")
     * @Method("GET")
     */
    public function indexAction(Request $request)
    {}
}

After call /dashboard i got No route found for "GET /dashboard"

Also, when i tried to run test with phpunit vendor/besimple/i18n-routing-bundle/tests/Routing/Loader/AnnotatedRouteControllerLoaderTest.php

i got: errors

What i am doing wrong? Could someone help me?

Thanks

@boekkooi
Copy link
Collaborator

Hi @krombox,

Sorry for the late reply! It seems that you are running into a bug could you please provided me this the symfony version that you are using?

Also did you enable the annotation in the bundle configuration?

# app/config/config.yml
be_simple_i18n_routing:
    #  if true, enables the annotation route loader
    annotations: true

@barthy-koeln
Copy link

Hello @boekkooi !

I'm having the same trouble...
Symfony 2.8.11
also on dev-master

@samuelvi
Copy link

samuelvi commented Oct 6, 2016

Hi,
Having same issue. It seems that folder src/Routing/Annotation does not exists.
My line in composer: "besimple/i18n-routing-bundle": "^2.3"
Thanks!

@betonowelasy
Copy link

I also have this problem. Symfony version 3.1.5

@cruiser12
Copy link

same issue

@faruktemur
Copy link

same issue @boekkooi. Would you please check
Symfony version: 3.1.6
package: dev-master

@Powerhamster
Copy link

Powerhamster commented Dec 18, 2016

Make sure the line
new BeSimple\I18nRoutingBundle\BeSimpleI18nRoutingBundle(), is above new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), in your AppKernel.php
so the loaders of the bundle are added before the default annotation loaders of symfony.

@RuslanZavacky
Copy link

@Powerhamster doesn't seem to work, any other ideas, why it might not work?

@Powerhamster
Copy link

@RuslanZavacky I have no other idea, this fixed it for me.

@horusagency
Copy link

I also have this problem Symfony 2.8.17

@janwebdev
Copy link

janwebdev commented Apr 23, 2017

FYI, the following steps helped me on Symfony 3.2.7 to work with annotations:
After installation and configuration of the bundle:

  1. AppKernel:
    new BeSimple\I18nRoutingBundle\BeSimpleI18nRoutingBundle()
    should be before
    new Symfony\Bundle\FrameworkBundle\FrameworkBundle()
  2. refresh the page with @I18nRoute annotation
  3. clear the cache
    It works.
    Hope this helps someone.

@hgabka
Copy link

hgabka commented Sep 21, 2017

Thanks, janwebdev, that worked for me too on Symfony 3.3

@kusiu
Copy link

kusiu commented Mar 14, 2018

Hey guys,

When new BeSimple\I18nRoutingBundle\BeSimpleI18nRoutingBundle() is at the beginning, does
annotation @Route still work for you?

@ClementHugon
Copy link

@janwebdev, worked for me too. Thanks

But all @route annotations should be replaced by @i18nroute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests