• <i id='Ppwet'><tr id='Ppwet'><dt id='Ppwet'><q id='Ppwet'><span id='Ppwet'><b id='Ppwet'><form id='Ppwet'><ins id='Ppwet'></ins><ul id='Ppwet'></ul><sub id='Ppwet'></sub></form><legend id='Ppwet'></legend><bdo id='Ppwet'><pre id='Ppwet'><center id='Ppwet'></center></pre></bdo></b><th id='Ppwet'></th></span></q></dt></tr></i><div id='Ppwet'><tfoot id='Ppwet'></tfoot><dl id='Ppwet'><fieldset id='Ppwet'></fieldset></dl></div>

    <small id='Ppwet'></small><noframes id='Ppwet'>

      • <bdo id='Ppwet'></bdo><ul id='Ppwet'></ul>

        <tfoot id='Ppwet'></tfoot><legend id='Ppwet'><style id='Ppwet'><dir id='Ppwet'><q id='Ppwet'></q></dir></style></legend>

        如何在 yii 框架中自动设置 url 友好

        how to setup url friendly in yii framework automatically (如何在 yii 框架中自动设置 url 友好)

          <bdo id='DLG63'></bdo><ul id='DLG63'></ul>

            <small id='DLG63'></small><noframes id='DLG63'>

            1. <i id='DLG63'><tr id='DLG63'><dt id='DLG63'><q id='DLG63'><span id='DLG63'><b id='DLG63'><form id='DLG63'><ins id='DLG63'></ins><ul id='DLG63'></ul><sub id='DLG63'></sub></form><legend id='DLG63'></legend><bdo id='DLG63'><pre id='DLG63'><center id='DLG63'></center></pre></bdo></b><th id='DLG63'></th></span></q></dt></tr></i><div id='DLG63'><tfoot id='DLG63'></tfoot><dl id='DLG63'><fieldset id='DLG63'></fieldset></dl></div>

              1. <legend id='DLG63'><style id='DLG63'><dir id='DLG63'><q id='DLG63'></q></dir></style></legend>
                    <tbody id='DLG63'></tbody>
                • <tfoot id='DLG63'></tfoot>

                  本文介绍了如何在 yii 框架中自动设置 url 友好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我刚刚学习了 yii 框架并阅读了本教程关于 yii 如何设置 url

                  I just learning yii framework and read this tutorial about yii how to setup url

                  但我不知道,假设我有 10 个控制器,我应该在配置文件中一个一个地定义控制器吗?有没有更好的方法来为所有控制器设置 url 友好,例如 www.yoursite.com/yourController/yourAction/yourID?

                  but I have no idea, suppose i have 10 controllers, should I define one by one controllers in the config file ? is there a better way to setup url friendly like www.yoursite.com/yourController/yourAction/yourID for all controller ?

                  我认为 codeigniter 是自动完成的...... yii 怎么样?

                  I think codeigniter did that automatically ... how about yii ?

                  推荐答案

                  在/protected/config/main.php 添加..

                  In /protected/config/main.php add..

                      'urlManager'=>array(
                          'urlFormat'=>'path',
                          'showScriptName' => false,      
                          ),
                      ),
                  

                  在您的网络根目录中添加一个 .htaccess..

                  In your web root an .htaccess..

                  Options +FollowSymLinks
                  IndexIgnore */*
                  RewriteEngine on
                  
                  # if a directory or a file exists, use it directly
                  RewriteCond %{REQUEST_FILENAME} !-f
                  RewriteCond %{REQUEST_FILENAME} !-d
                  
                  # otherwise forward it to index.php
                  RewriteRule . index.php
                  

                  这篇关于如何在 yii 框架中自动设置 url 友好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Converting between timezones in PHP(在 PHP 中的时区之间转换)
                  PHP - strtotime, specify timezone(PHP - strtotime,指定时区)
                  Get current date, given a timezone in PHP?(获取当前日期,给定 PHP 中的时区?)
                  List of US Time Zones for PHP to use?(PHP 使用的美国时区列表?)
                  How to detect Ambiguous and Invalid DateTime in PHP?(如何在 PHP 中检测不明确和无效的 DateTime?)
                  How to update timezonedb in PHP (updating timezones info)?(如何在 PHP 中更新 timezonedb(更新时区信息)?)
                  <i id='RJwwK'><tr id='RJwwK'><dt id='RJwwK'><q id='RJwwK'><span id='RJwwK'><b id='RJwwK'><form id='RJwwK'><ins id='RJwwK'></ins><ul id='RJwwK'></ul><sub id='RJwwK'></sub></form><legend id='RJwwK'></legend><bdo id='RJwwK'><pre id='RJwwK'><center id='RJwwK'></center></pre></bdo></b><th id='RJwwK'></th></span></q></dt></tr></i><div id='RJwwK'><tfoot id='RJwwK'></tfoot><dl id='RJwwK'><fieldset id='RJwwK'></fieldset></dl></div>
                • <tfoot id='RJwwK'></tfoot>
                  <legend id='RJwwK'><style id='RJwwK'><dir id='RJwwK'><q id='RJwwK'></q></dir></style></legend>
                    <tbody id='RJwwK'></tbody>

                    <small id='RJwwK'></small><noframes id='RJwwK'>

                          <bdo id='RJwwK'></bdo><ul id='RJwwK'></ul>