Thinkphp MVC以及4種url放文方式

三、ThinkPHP的MVC對應的目錄   //瞭解
    M 項目目錄/應用目錄(Home)/Lib/Model

    V 項目目錄/應用目錄(Home)/Tpl

    C 項目目錄/應用目錄(Home)/Lib/Action


url的4種訪問方式          //重點!

        public function getshow(){
              echo "你的姓名:".$_GET['name']."   你的年齡:".$_GET['age'];        
         }   

        1.PATHINFO 模式 -- 常用方法
                http://localhost:8080/Think3.2/index.php/User/getshow/name/tim/age/18
                http://域名/項目名/入口文件/模塊名/方法名/鍵1/值1/鍵2/值2
        2.普通模式
                http://localhost:8080/Think3.2/index.php?m=User&a=getshow&name=tim&age=18
                http://域名/項目名/入口文件?m=模塊名&a=方法名&鍵1=值1&鍵2=值2
        3.REWRITE模式
                http://localhost:8080/Think3.2?m=User&a=getshow&name=tim&age=18
                http://域名/項目名/模塊名/方法名/鍵1/值1/鍵2/值2
        4.兼容模式
                http://localhost:8080/Think3.2/index.php?s=User/getshow/name/tim/age/18
                http://域名/項目名/入口文件?s=模塊名/方法名/鍵1/值1/鍵2/值2

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章