模式和路径之间有什么区别?

时间:2022-03-23 13:21:25

I'm learning Symfony2 and I was wondering what the difference is between a pattern and a path in the demo that contains a "pattern"? I.e.:

我正在学习Symfony2,我想知道模式和包含“模式”的演示中的路径之间有什么区别?即:

acme_hello_namespace_homepage:
    pattern:  /hellons/{name}
    defaults: { _controller: AcmeHelloNamespaceBundle:Default:index }

hello:
    path:     /hellons/{name}
    defaults: { _controller: AcmeHelloNamespaceBundle:Hello:index }

1 个解决方案

#1


18  

That's the same thing, but "pattern" is now deprecated in favor of "path" as you can see here : https://github.com/symfony/symfony/pull/6738/files#diff-0

这是一回事,但“模式”现在已被弃用,有利于“路径”,如下所示:https://github.com/symfony/symfony/pull/6738/files#diff-0

#1


18  

That's the same thing, but "pattern" is now deprecated in favor of "path" as you can see here : https://github.com/symfony/symfony/pull/6738/files#diff-0

这是一回事,但“模式”现在已被弃用,有利于“路径”,如下所示:https://github.com/symfony/symfony/pull/6738/files#diff-0