Symfony错误无法找到模板

时间:2015-02-10 16:14:31

标签: php symfony payum

设置paypal快速结账后,我现在按照here提供的说明设置条带支付网关但是我收到错误

Unable to find template "@PayumStripe/Action/obtain_checkout_token.html.twig" : "Bundle "PayumStripe" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file?"

根据说明,我在AppKernel中添加了以下内容,还需要添加哪些内容?

new Payum\Bundle\PayumBundle\PayumBundle(),

2 个答案:

答案 0 :(得分:1)

我查看了正在开发的文档,看了stable版本的documtation后我发现我错过了config.yml中路径的映射

根据文档,路径应该是

paths:
    %kernel.root_dir%/../vendor/payum/payum/src/Payum/Core/Resources/views: PayumCore
    %kernel.root_dir%/../vendor/payum/payum/src/Payum/Stripe/Resources/views: PayumStripe

但是我觉得这是不正确的,因为那些目录不存在,这是我们看到的错误,所以这些路径必须得到纠正,以下内容对我有用

paths:
    %kernel.root_dir%/../vendor/payum/core/Payum/Core/Resources/views: PayumCore
    %kernel.root_dir%/../vendor/payum/core/Payum/Core/Bridge/Symfony/Resources/views: PayumSymfonyBridge
    %kernel.root_dir%/../vendor/payum/stripe/Payum/Stripe/Resources/views: PayumStripe 

答案 1 :(得分:0)

您需要将此添加到routing.yml:

# app/config/routing.yml

payum_capture:
    resource: "@PayumBundle/Resources/config/routing/capture.xml"

payum_authorize:
    resource: "@PayumBundle/Resources/config/routing/authorize.xml"

payum_notify:
    resource: "@PayumBundle/Resources/config/routing/notify.xml"

取自此处:http://payum.org/doc/0.14/PayumBundle/get_it_started