[eluser]msteudel[/eluser]
Hi All,
I have your table listing out a bunch of items to that can be edited/deleted
e.g.
Name | Actions
Mark | Edit - Delete
Bill | Edit - Delete
etc.
I have the following view:
Code:
<table class="data">
<tr>
<th>Id</th>
<th>District</th>
<th>State</th>
<th>Actions</th>
</tr>
<?php foreach( $districts as $district ): ?>
<tr>
<td><?php echo $district['id'] ?></td>
<td><?php echo $district['district_name'] ?></td>
<td><?php echo $district['state_name'] ?></td>
<td><?php $this->load->view( 'admin/district/format_actions') ?></td>
</tr>
<?php endforeach ?>
</table>
My thought of how to generate the actions (Edit - Delete) was to either use another view or use a helper. I initially went with the view idea and have this:
Code:
<?php echo anchor( '/admin/district/update/' . $district['id'], 'Edit') ?> |
<?php echo anchor( '/admin/district/delete/' . $district['id'], 'Delete') ?>
But $district isn't available to the format_actions view. I'm not sure if there is an easy way to pass a variable into a "sub-view". If there isn't then I guess I'll go for a helper ...
Any thoughts?
TIA, Mark