python - 关于flask路由方法中参数重新赋值的问题
伊谢尔伦
伊谢尔伦 2017-04-18 09:53:40
0
3
318

为什么不能对page重新赋值,我试过,将方法里面的page改成其他名字,就是跳过这个赋值的方法,直接访问网络路径。 /teaInfo/2 可以访问不同于 /teaInfo/1的数据。

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all (3)
左手右手慢动作

Do I need to write two methods, similar

    洪涛

    When you add a page parameter to a route, you need a parameter pgae with the same name in the corresponding function, so you change the parameter name in the route, and the function cannot accept that parameter, so an error will be reported.
    You probably want different codes for passing the page and not passing the page. You can set pageg=None to determine whether the page is given or not.

      刘奇

      This should be handled in two methods

      teach_list()

      teach_detail()

        Latest Downloads
        More>
        Web Effects
        Website Source Code
        Website Materials
        Front End Template
        About us Disclaimer Sitemap
        php.cn:Public welfare online PHP training,Help PHP learners grow quickly!