yaoliuyang

1.在路由(route.php)中定义一条路由

Route::rule(\'new/:name/:id\',\'index/News/read\');

2.在index下的controller控制器中新建一个News控制器

<?php
/**
 * Created by PhpStorm.
 * User: yly
 * Date: 2020/2/12
 * Time: 13:43
 */
namespace  app\index\controller;

class News{
  public function  read($name,$id){
      return \'hello\'.$name.\':  您的学号是: \'.$id;
  }
}

3.在浏览器中调用如图所示

 

分类:

技术点:

相关文章:

  • 2022-01-01
  • 2021-10-05
  • 2022-01-21
  • 2019-09-18
  • 2021-04-22
  • 2021-05-09
猜你喜欢
  • 2021-08-27
  • 2021-12-07
  • 2021-11-05
  • 2021-12-05
  • 2020-04-10
  • 2021-10-03
  • 2021-08-13
相关资源
相似解决方案