<div class="zfdoctrine-modellist zfdoctrine-model-<?php echo $this->modelName; ?>">
    <?php if ($this->options['addRecordAction']): ?>
    <ul class="zfdoctrine-add">
        <li><a href="<?php echo $this->url(array('action' => $this->options['addRecordAction'])); ?>">Add</a></li>
    </ul>
    <?php endif; ?>

    <table class="zfdoctrine-list">
        <thead>
            <tr>
                <?php foreach ($this->fieldNames AS $name): ?>
                    <?php if (isset($this->options['fieldLabels'][$name])): ?>
                    <th><?php echo $this->escape($this->options['fieldLabels'][$name]); ?></th>
                    <?php else: ?>
                    <th><?php echo $this->escape($name); ?></th>
                    <?php endif; ?>
                <?php endforeach; ?>
                <?php if ($this->options['editRecordAction'] || $this->options['deleteRecordAction']): ?>
                <th>Options</th>
                <?php endif; ?>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($this->paginator AS $record): ?>
            <tr>
                <?php foreach ($this->fieldNames AS $name): ?>
                    <td class="zfdoctrine-field-<?php echo $name; ?>"><?php echo $this->escape($record->$name); ?></td>
                <?php endforeach; ?>
                <?php if ($this->options['editRecordAction'] || $this->options['deleteRecordAction']): ?>
                <td class="zfdoctrine-options">
                    <?php if ($this->options['editRecordAction']): ?>
                    <a href="<?php echo $this->url(array('action' => $this->options['editRecordAction'], 'id' => $record->identifier())); ?>">Edit</a>
                    <?php endif; ?>

                    <?php if ($this->options['deleteRecordAction']): ?>
                    <a href="<?php echo $this->url(array('action' => $this->options['deleteRecordAction'], 'id' => $record->identifier())); ?>">Delete</a>
                    <?php endif; ?>
                </td>
                <?php endif; ?>
            </tr>
            <?php endforeach; ?>
        </tbody>
    </table>

<?php
$paginationControl = $this->paginationControl(
    $this->paginator, $this->options['paginationStyle'], $this->options['paginationScript']
);
echo $paginationControl;
?>
</div>