Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何使用Silex注释提供程序指定Silex路由名称?_Php_Silex - Fatal编程技术网

Php 如何使用Silex注释提供程序指定Silex路由名称?

Php 如何使用Silex注释提供程序指定Silex路由名称?,php,silex,Php,Silex,我正在使用在Silex应用程序中创建路由。我还想使用Silex根据路由名称创建URL 问题是注释提供程序不允许我指定路由名称,因此,我无法使用Silex的UrlGenerator 在使用silex注释提供程序时,我如何为路线命名?有一个注释,可以让您为路线命名。例如: use DDesrosiers\SilexAnnotations\Annotations as SLX; /** * @SLX\Controller */ class TestController { /**

我正在使用在Silex应用程序中创建路由。我还想使用Silex根据路由名称创建URL

问题是注释提供程序不允许我指定路由名称,因此,我无法使用Silex的UrlGenerator

在使用silex注释提供程序时,我如何为路线命名?

有一个注释,可以让您为路线命名。例如:

use DDesrosiers\SilexAnnotations\Annotations as SLX;

/**
 * @SLX\Controller
 */
class TestController
{
    /**
     * @SLX\Route(
     *      @SLX\Request(method="GET", uri="foo"),
     *      @SLX\Bind(routeName="foo")
     * )
     */
    public function testMethod()