Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
861 views
in Technique[技术] by (71.8m points)

php - You have requested a non-existent service "templating"

i'm trying to get FOSOAuthServerBundle to work on my project Running symfony 3.4.0

templating seems to be missing but i can't find anything about it on google. any idea what it could be? twig is working perfectly otherwise

i've cleared the cache downgraded from 3.4.1 to 3.4.0

AuthorizeController.php >

return $this->container->get('templating')->renderResponse(
        'FOSOAuthServerBundle:Authorize:authorize.html.'.$this->container->getParameter('fos_oauth_server.template.engine'),
        array(
            'form'   => $form->createView(),
            'client' => $this->getClient(),
        )
);

this is where its crashing.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I'm assuming you're using Symfony Flex, since it has this minimalist approach it doesn't come with twig, which is the default templating system for Symfony.

Please install it via:

composer require twig

In any case if you have already twig installed but it's not working, make sure your configurations has it available:

# app/config/config.yml

framework:
    # ...
    templating:
        engines: ['twig']

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...