liftweb的用户注册实现-2.println

println是一个博客系统,只允许一个人注册

 

User扩展了MetaMegaProtoUser,所以override了signupXhtml

 

 

override def screenWrap = Full(
		<lift:surround with="default" at="main">
			<lift:bind/>
		</lift:surround>
	)

override def signupFields = List(email, password)

override def signupXhtml(user: TheUserType) = {
		if (User.findAll().length >= 1)
			<span/>
		else
			(<form method="post" action={S.uri}>
				<h1>{ S.??("sign.up") }</h1>
				<table>
					{localForm(user, false, signupFields)}
					<tr><td> </td><td><user:submit/></td></tr>
				</table>
			</form>)
	}

 

index.html中定义了一个链接:

 

 

	<span class="lift:Blog.step1register">
		<h1>New Installation</h1>

		<p>Welcome to your fresh Installation of println.</p>
		
		<p>Step One: <a href="/users/sign_up">Register an Account</a>.</p>
	</span>
 

 

 

 

你可能感兴趣的:(print)