Is this the most efficient way of getting data for your FuelPHP project? I feel like I'm doing a lot of... not clean things for this project and I want to start off the right way while I'm still early in development.
Anyway, I'm working on a news system panel pulling news post by month.
ANYWAY, if there is only one news posting available.. the foreach gets all F'ed up... but if there is more than one, it pulls fine. WHICH I KNOW WHY. But I find it unecessary to go through the array, check if there is more than one iteration, and then choose the correct loop/non-looping process WHILE still in the view... since the view should be free from PHP as much as possible. :/
You can make your model method a lot shorter by using execute()->as_array(). It will return the result in an array, no more need for conversions. I would do the date conversion in the view, that's clearly presentation code.
I don't see anything wrong with the view. If you have an index page with a table-view (rows representing records), the only way to display them is to iterate.
I had as_array before... still doesn't do anything. With a foreach, if there is NO array.. it.. acts all weird. I mean there is an array, but then it gets turned into a multidimensional array when more than one record is pulled.. it doesn't iterate correctly with just one record. :/