• <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 友好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <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>