1 public function show() 2 { 3 echo "获取完整URL地址 不带域名:<br />"; 4 echo Request::url(); 5 echo "<br />"; 6 7 echo "获取完整URL地址 带域名:<br />"; 8 echo Request::url(true); 9 echo "<br />"; 10 11 //获取当前控制器 12 echo "当前的控制器首字母大写为:<br />"; 13 echo Request::controller(); 14 echo "<br />"; 15 echo "当前的控制器首字母为:<br />"; 16 echo Request::controller(true); 17 echo "<br />"; 18 19 //获取当前操作 20 echo "当前的操作为:<br />"; 21 echo request()->action(); 22 }输出结果为: