2011-12-27 4 views
2

나는 간단한 리프트 페이지를리프트 스 니펫에서 페이지 매개 변수를 가져 오는 방법은 무엇입니까?</p> <pre><code><html> <head></head> <body> <span id="content" class="lift:GetContent"></span> </body> </html> </code></pre> <p>간단한 미리보기 :

class GetContent { 
    def render = "#content" #> "someValue" 
} 

URL에 전달, 어떻게 매개 변수를 얻을 수있다 질문 (page.html?param=value을 같은)? 당신의 조각 클래스가 인스턴스화 될 때

답변

6

이 매개 변수는 S.param에서 사용할 수 있습니다

class GetContent { 
    val param = S.param("param") openOr "No parameter given" 
    def render = "#content" #> param 
}