路由注释不适用于18nRoutingBundle

时间:2018-03-01 12:47:26

标签: php symfony routing internationalization

I18nRoutingBundle似乎没有为Symfony 3.4工作。

JobController.php

use BeSimple\I18nRoutingBundle\Routing\Annotation\I18nRoute;

class JobController extends Controller
{
    /**
     *
     * @I18nRoute({ "en": "/jobs", "pl": "/ogloszenia" }, name="jobs")
     * @Method("GET")
     */
    public function jobsListAction()
    {
        $jobs = $this->getDoctrine()
            ->getRepository(Job::class)
            ->findAllActive();

        return $this->render('job/list.html.twig', [
            'jobs' => $jobs,
        ]);
    }
}

config.yml

be_simple_i18n_routing:
    annotations: true

错误:

An exception has been thrown during the rendering of a template ("I18nRoute "jobs" (pl) does not exist.").

我正在努力为注释路由找到任何其他捆绑包i18n。有什么帮助吗?

0 个答案:

没有答案