Location: PHPKode > scripts > Paginator Iterator > paginator-iterator/templates/example.tpl
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Paginator Iterator</title>
	<style type="text/css">
		{literal}
		body {
			font: 12px verdana;
		}
		.paginator span {
			border: 1px solid #336699;
			padding: 8px 16px;
			color: white;
			background-color: black;
		}
		.paginator a {
			border: 1px solid #FF9999;
			padding: 3px 7px;
			text-decoration: none;
			color: blue;
		}
		.paginator a:hover {
			color: #F00000;
			background-color: #CCCCCC;
		}
		a.first-last, a.first-last:hover {
			color: #FFFFFF;
			background-color: #CCC;
		}
		{/literal}
	</style>
</head>
<body>
<br/><br/>

	{p_iterator id="rec" ds=$ds numrows=$numrows rowsperpage=6 pageno=$smarty.get.pageno}

		{p_header}
			<div class="paginator" align="center">
				{if $rec.is_first_page}
					<a class="first-last">First</a>
					<a class="first-last">Prev</a>
				{else}
					<a href="example.php?pageno={$rec.first}">First</a>
					<a href="example.php?pageno={$rec.prev}">Prev</a>
				{/if}
				
				{section name="i" loop=$rec.pages}
					{if $rec.pages[i] ne $rec.pageno}
						<a href="example.php?pageno={$rec.pages[i]}">{$rec.pages[i]}</a>
					{else}
						<span>{$rec.pages[i]}</span>
					{/if}
				{/section}

				{if $rec.is_last_page}
					<a class="first-last">Next</a>
					<a class="first-last">Last</a>
				{else}
					<a href="example.php?pageno={$rec.next}">Next</a>
					<a href="example.php?pageno={$rec.last}">Last</a>
				{/if}
			</div>

			<br/><br/>
			<table width="100%" border="1">
		{/p_header}
		
		{p_item}
			<tr>
				<td>{$rec.data.name}</td>
				<td>{$rec.data.link}</td>
			</tr>
		{/p_item}

		{p_alternating}
			<tr style="background-color:#FFFF99;">
				<td>{$rec.data.name}</td>
				<td>{$rec.data.link}</td>
			</tr>
		{/p_alternating}

		{p_empty}
			<tr>
				<td>No records found</td>
			</tr>
		{/p_empty}

		{p_footer}
			</table>
		{/p_footer}

	{/p_iterator}

</body>
</html>
Return current item: Paginator Iterator