2016-08-02 50 views
0

什麼是request.function用於web2py。我是一個初學者web2y和教程web2py中的request.function

if not request.function=='first' and not session.visitor_name: 
    redirect(URL('first')) 

是用來做什麼request.function在這些線路來的?

+1

[閱讀文檔]有什麼問題(http://web2py.com/books/default/chapter/29/04/the-core#request)? – Selcuk

回答

1

documentation.

request.function: the name of the requested function.

所以你的情況作出。

if not request.function=='first' and not session.visitor_name: 
    redirect(URL('first')) 

它檢查函數的名稱是否不是first