[eluser]Unknown[/eluser]
Good people of CodeIgnitor, I am sure there is a simple answer to this but at the moment I can't see it.
I am dynamically looping through a database table in a view like so:
Code:
<?php foreach($records as $rows): ?>
<article class="summary">
<h2><?php echo $rows->title;?></h2>
<time class="summary-date" datetime="<?php
// Find a CodeIgnitor-friendly way of displaying date as below
echo strftime("%Y-%m-%d", strtotime($rows->date));
?>"><?php
// Find a CodeIgnitor friendly way of display date as below
echo strftime("%B %d, %Y", strtotime($rows->date)); ?></time>
<div class="summary-category">Category: <a href=""><?php echo $rows->category_id; ?></a></div>
<div class="summary-teaser"><?php
// Uses text helper for nice clean break in string near to 320 characters
// Also uses typograhpy class to add HTML to the database text
// This produces nicely formatted blocks to text
echo $this->typography->auto_typography(character_limiter($rows->body, 320));
?></div>
<div class="read-more">Read more</div>
</article>
<?php endforeach; ?>
Now I need to take the value of the category variable (at the moment it is just a number) and take it back to the constructor and from there make a model database call so as to find the name of the category (relational databases and all that).
Now the question is how do I do that?