intahwebz/routing

此包最新版本(0.9.6)没有可用的许可证信息。

0.9.6 2015-03-03 13:12 UTC

This package is auto-updated.

Last update: 2024-09-12 04:44:17 UTC


README

一个将URL映射到控制器并解析变量的组件。

$contentView = [Resource::CONTENT, Privilege::VIEW];

$adminView = [Resource::ADMIN, Privilege::VIEW];

array(

    array(
        'name' => 'image',
        'pattern' => '/{path}/{imageID}/{size}/{filename}',
        'callable' => array(
            'BaseReality\\ImageController',
            'showImage',
        ),
        'requirements' => array(
            'imageID' => '\d+',
            'size' => '\w+',
            'filename' => '[^/]+',
            'path' => "(image|proxy)",
        ),
        'defaults' => array(
            'path' => 'image',
            'size' => null
        ),
        'optional' => array(
    
        )
    ),
    
     array(
        'name' => 'homepage',
        'pattern' => '/',
        'callable' =>array(
            BaseReality\Controller\HomePage::class,
            'show',
        ),
        'access' => $contentView,
     ),
 
 ),