Code
import net.liftweb.util.Helpers._ case class Customer( name: String, company: String, companyWebsite: String ) val customers = List( Customer( "Martin Odersky", "Typesafe Inc.", "http://www.typesafe.com"), Customer( "Steve Ballmer", "Microsoft Inc.", "http://www.microsoft.com"), Customer( "Bill Venners", "Artima Inc.", "http://www.artima.com/") ) val snipet = ".customer *" #> customers.map { customer => ".name *" #> customer.name & ".company *" #> customer.company & ".company [href]" #> customer.companyWebsite } val html = <ul> <li class="customer"> <div class="name">Bob Foo</div> <a class="company" href="ecma.com"> ECMA inc. </a> </li> </ul> snipet( html )
Result