Joomla Back End MVC Step by Step Tutorial - Part 5: After update controller for pagination. Now, we will update our view at "admin.hello.html.php".

<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
class HTML_hellos
{
function showHellos($option, &$rows, &$pageNav){
JHTML::_('behavior.tooltip');
?>
<form action="index.php?option=com_hello"
method="post" name="adminForm">
<table>
<tr>
<td align="left" width="100%">
<?php echo JText::_( 'Filter' ); ?>:
<input type="text" name="search"
id="search"
value="<?php echo $lists['search'];?>"
class="text_area"
onchange="document.adminForm.submit();" />
<button onclick="this.form.submit();">
<?php echo JText::_( 'Go' ); ?></button>
<button onclick="document.getElementById('search').value='';
this.form.submit();">
<?php echo JText::_( 'Reset' ); ?></button>
</td>
</tr>
</table>
<table class="adminlist">
<thead>
<tr>
<th width="20">
<input type="checkbox" name="toggle" value=""
onclick="checkAll(<?php echo count($rows)?>)">
</th>
<th width="50" class="title">
<?php echo JHTML::_('grid.sort', 'ID', 'id',
@$lists['order_Dir'],
@$lists['order'] ); ?>
</td>
<th><?php echo JHTML::_('grid.sort',
'Message', 'message',
@$lists['order_Dir'],
@$lists['order'] ); ?></th>
<th nowrap="nowrap">
<?php echo JHTML::_('grid.sort',
'Published', 'published',
@$lists['order_Dir'],
@$lists['order'] ); ?></th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="11">
<?php echo $pageNav->getListFooter(); ?>
</td>
</tr>
</tfoot>
<?php
$k = 0;
for($i=0, $n=count($rows); $i < $n ; $i++)
{
$row = &$rows[$i];
$checked = JHTML::_('grid.id', $i, $row->id);
$published = JHTML::_('grid.published', $row, $i);
$link = JRoute::_( 'index.php?option=com_hello&task=edit&cid[]='. $row->id );
?>
<tr class="<?php echo "row$k"; ?>">
<td><?php echo $checked?></td>
<td><a href="<?php echo $link; ?>">
<?php echo $row->id?></a></td>
<td><?php echo $row->message?></td>
<td><?php echo $published?></td>
</tr>
<?
$k = 1 - $k;
}
?>
</table>
<input type="hidden" name="option" value="com_hello">
<input type="hidden" name="task" value="">
<input type="hidden" name="boxchecked" value="0">
<input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir"
value="" />
</form>
<?php
}
}
?>
The result may like this:
