zoukankan      html  css  js  c++  java
  • TP5.1:request请求对象(使用四种方式获取)

      准备:

      在index/controller下创建一个名为requests.php的文件(注意:不要起名为request,因为它是关键字,不被允许起名

      动态方法和静态方法的区别:

      静态方法:public  static  function  test(){}

      动态方法:;public  function  test(){}

      可以看出,他们的区别就是一个是静态方法,一个是普通方法。

      动态方法使用请求

        

         通过url访问:localhost/tp5的框架目录/thinkpublic//index.php/index/requests/request?name='小仓鼠'&age=18

      

       通过静态代理使用

      

      输出结果:

      

      通过依赖注入使用请求

      

      结果:

      通过Controller类中封装好的属性进行使用

        

        结果:

      以上

      END

      

      

  • 相关阅读:
    install git on ubuntu
    deploy uwsgi with niginx on ubuntu
    ubuntu下部署solr
    solr relevent project
    20100722
    [Programming Visual C++]Ex05cCScrollView Revisited
    iter_test
    交友类节目
    install scrapy on windows
    20100703
  • 原文地址:https://www.cnblogs.com/ianlab/p/14807220.html
Copyright © 2011-2022 走看看