Home  >  Q&A  >  body text

No error is reported but the value cannot be obtained and can only be printed out. Learn

<?php

namespace app\index\controller;
use think\Controller;
class Test1 extends Controller
{
   public function index(){
       return 'shepi';
   }
   public function demo3()
   {
       return '学习'.$this->request->param('lesson');
   }
   public function demo4()
   {
       return '学习'.$this->request->get('lesson');
       //return '学习'.Request::instance()->param('lesson');
   }
}

实.实.2422 days ago1622

reply all(3)I'll reply

  • 梦游天下

    梦游天下2018-04-15 17:26:21

    tp5.com/index/test1/demo3/lesson/dddd The test is fine. Did you use the demo4 method?

    reply
    0
  • 实.

    实.2018-03-27 09:57:38

    The value is passed tp5.com/index/test1/demo3/lesson/dddd

    reply
    0
  • 路过

    路过2018-03-27 08:26:51

    Did you pass the value?

    reply
    0
  • Cancelreply