Yii2参数化路由其他语言

时间:2018-01-04 02:41:26

标签: php routing yii2 multilingual

<!DOCTYPE html>
<html>
    
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>CS:GO Interactive Tools</title>
        <meta name="description" content="Raisaga's interactive CS:GO map and tools.">
        <link rel="stylesheet" href="main.css">
    </head>
    <body>
            
        <h1>Rai's CS:GO <br />
            Interactive Tool
        </h1>
        
        <div class="buttons">
            
            <a href="dust2.html">
                <button style="margin-top:100px;margin-left:80px;height:125px;width:222px;border-radius:7px;border-width:4px">
                DUST 2
                </button>
            </a>
            
            <a href="mirage.html">
                <button style="margin-top:100px;margin-left:80px;height:125px;width:222px;border-radius:7px;border-width:4px">
                MIRAGE
                </button>
            </a>
            
            <a href="cache.html">
                <button style="margin-top:100px;margin-left:80px;height:125px;width:222px;border-radius:7px;border-width:4px">
                CACHE
                </button>
            </a>
            
            <a href="overpass.html">
                <button style="margin-top:100px;margin-left:80px;height:125px;width:222px;border-radius:7px;border-width:4px">
                OVERPASS
                </button>
            </a>
            
            <a href="inferno.html">
                <button style="margin-top:70px;margin-left:80px;height:125px;width:222px;border-radius:7px;border-width:4px">
                INFERNO
                </button>
            </a>
            
            <a href="train.html">
                <button style="margin-top:70px;margin-left:80px;height:125px;width:222px;border-radius:7px;border-width:4px">
                TRAIN
                </button>
            </a>
            
            <a href="cobblestone.html">
                <button style="margin-top:70px;margin-left:80px;height:125px;width:222px;border-radius:7px;border-width:4px">
                COBBLESTONE
                </button>
            </a>
            
            <a href="office.html">
                <button style="margin-top:70px;margin-left:80px;height:125px;width:222px;border-radius:7px;border-width:4px">
                OFFICE
                </button>
            </a>
        </div>
        
    </body>
</html>

问题是我的控制器用英文命名,但网站用波兰语写成。

   'GET /<controller:(konto|aktywacja)>' => 'user/<controller>/reset',

我不知道如何在yii2框架中转换控制器以进行路由匹配。

我想制作参数化路线,以便在配置中获得更好的性能和更少的规则。

0 个答案:

没有答案