0
필자는 Exploring Lift라는 책에서 약간 수정 된 Listing 4.7을 사용하여 내 질문을 할 것이다.리프트의보기에서 스 니펫으로 매개 변수를 전달하는 방법은 무엇입니까?
// In Boot.boot:
LiftRules.viewDispatch.append {
case List("Expenses", "recent", acctId, authToken) =>
Left(() => Full(RSSView.recent(acctId, authToken)))
// This is a dispatch via the same LiftView object. The path
// "/Site/news" will match this dispatch because of our dispatch
// method defined in RSSView. The path "/Site/stuff/news" will not
// match because the dispatch will be attempted on List("Site","stuff")
case List("Site") => Right(RSSView)
}
// Define the View object:
object RSSView extends LiftView {
def dispatch = {
case "news" => siteNews
}
def recent(acctId : String, authToken : String)() : NodeSeq = {
// User auth, account retrieval here
...
<lift:surround with="rss" at="content">
<lift:Vote.image />
</lift:surround>
}
// Display a general RSS feed for the entire site
def siteNews() : NodeSeq = { ... }
}
최근의보기 기능에서 가져온 acctId를 스 니펫 리프트 : Vote.image에 어떻게 전달합니까? 감사.
부팅에서 acctId 및 authToken을 얻으려고하지 않습니다. 나는 다른 콘텐츠를 렌더링 할 수 있도록 URL에서 acctId를 캡처하고 싶습니다. 그러나 SessionVar는 이러한 목적으로 도움을줍니다. 감사. – coolsuntraveler