BeSimple / BeSimpleI18nRoutingBundle

NOT MAINTAINED - Full routing internationalized on your Symfony project
185 stars 63 forks source link

Annotations rooting not work #89

Open krombox opened 8 years ago

krombox commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

Hello @boekkooi !

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

samuelvi commented 8 years ago

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 commented 8 years ago

I also have this problem. Symfony version 3.1.5

cruiser12 commented 7 years ago

same issue

faruktemur commented 7 years ago

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

Powerhamster commented 7 years ago

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 commented 7 years ago

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

Powerhamster commented 7 years ago

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

horusagency commented 7 years ago

I also have this problem Symfony 2.8.17

janwebdev commented 7 years ago

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 commented 7 years ago

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

kusiu commented 6 years ago

Hey guys,

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

ClementHugon commented 6 years ago

@janwebdev, worked for me too. Thanks

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