25-08-2010, 09:16 AM
(25-08-2010, 08:57 AM)oxman a écrit : Un exemple de template :
Code PHP :<?php
<lift:surround with="default" at="content">
<div class="column span-24">
<h3>Your accounts</h3>
<div id="entryform">
<table>
<tr>
<th>Account Name</th>
<th>Description</th>
<th>Actions</th>
</tr>
<lift:Accounts.manage>
<account:entry>
<tr>
<td><acct:name /></td>
<td><acct:description /></td>
<td><acct:actions /></td>
</tr>
</account:entry>
</lift:Accounts.manage>
</table>
</div>
<br />
<h3><a href="/editAcct">Do you need to add an Account?</a></h3>
</div>
</lift:surround>
Un autre :
Code PHP :
<?php
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:lift="http://liftweb.net/">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<title>PocketChange: where did my money go?</title>
<lift:CSS.blueprint />
<lift:CSS.fancyType />
<script id="jquery" src="/classpath/jquery.js" type="text/javascript"></script>
<script id="json" src="/classpath/json.js" type="text/javascript"></script>
<link href="/style/pca.css" type="text/css" rel="stylesheet" media="screen, projection" />
</head>
<body>
<div class="container">
<div id="status-message"><strong>Note:</strong> PocketChange is totally awesome. I dare you to try it. And then give us money.</div>
<div class="column span-24">
<div id="title"><a href="/"><img src="/images/pca-logo.png" /></a>
</div>
</div>
<div class="column span-24" id="menu">
<!--<lift:Menu.builder li:class="menuitem" />
li:class="menuitem"
li_item:class="selectedMenu"
li_item:onclick="javascript:alert('Already selected!');"
-->
<lift:Menu.builder
li:class="menuitem"
li_item:id="selectedMenu"
/>
</div>
<div class="column span-24">
<lift:snippet type="msgs">
<lift:error_msg>Error! The details are:</lift:error_msg>
<lift:error_class>errorBox</lift:error_class>
<lift:warning_msg>Whoops, I had a problem:</lift:warning_msg>
<lift:warning_class>warningBox</lift:warning_class>
<lift:notice_msg></lift:notice_msg>
<lift:notice_class>noticeBox</lift:notice_class>
</lift:snippet>
<br />
</div>
<div class="column span-24">
<lift:bind name="content" />
</div>
<hr />
<div class="column span-24 last" style="text-align: center">
Copyright © 2009, 2010 - Marius Danciu, Derek Chen-Becker and Tyler Weir
</div>
<script>
$(document).ready(function() {
$(".noticeBox").click(function(){$(this).fadeOut("slow");});
$(".errorBox").click(function(){$(this).fadeOut("slow");});
$(".warningBox").click(function(){$(this).fadeOut("slow");});
});
</script>
</div>
</body>
</html>