主要作用:隐藏自己的真实路由名称

application/Route.php

使用方法一:

<?php
use think\Route;
Route::alias('home','index/index');
Route::alias('admin','admin/index');

方法二:

<?php

return [
'__pattern__' => [
'name' => '\w+',
],
'[hello]' => [
':id' => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
':name' => ['index/hello', ['method' => 'post']],
], '__alias__' => [
'home' => 'index/index',
'admin'=> 'admin/index'
], ];

http://localhost/thinkphp/index.php/home/test 同等与http://localhost/thinkphp/index.php/index/index/test

http://localhost/thinkphp/index.php/admin/edit/ 同等与http://localhost/thinkphp/index.php/admin/index/edit

注释:别名 => ‘模型/控制器’ ( 别名等于模块+控制器)

最新文章

  1. webrtc中APM(AudioProcessing module)的使用
  2. TableView与delegate、dataResource
  3. 控制台telnet连接后无法关闭
  4. php中json_encode UTF-8中文乱码问题
  5. shell中&amp;&amp;和||的使用方法_转
  6. Spring配置文件解析--依赖注入
  7. phpStudy Linux安装集成环境 (CentOS--7)
  8. vi/vim使用指北 ---- Moving Around in a Hurry
  9. DOM基础之“寻找”子节点
  10. Infix expression 计算 without &#39;(&#39; and &#39;)&#39;
  11. 3.3.2 PCI设备对不可Cache的存储器空间进行DMA读写
  12. Framework启动过程浅析
  13. tensorflow(3)可视化,日志,调试
  14. js原生事件系统与坐标系统
  15. Saiku关于MDX过滤的使用(九)
  16. 创建cocoapod静态库发布到网上使用
  17. python(nmap模块、多线程模块)
  18. Java线程同步与锁
  19. Git 执行更改
  20. 【已解决】wepy中使用分包加载报错

热门文章

  1. BAT-局域网内在线电脑IP
  2. 如何在线程中获取spring 管理的bean
  3. laravel 5.4在控制器构造函数中获取auth中间件失败
  4. java基础篇---枚举详解
  5. bzoj1103【POI2007】大都市meg
  6. [转]uboot中SPI Flash Booting配置
  7. [watchdog]内核失败的重启方案
  8. ansible wc -l 对结果值取大小的操作
  9. bootstrap底部消息提示插件
  10. Visual Studio “14” CTP 3 Released