/** * Output dates as friendly dates * @developer Brandon Hansen * @date May 16, 2010 */ public function __get($key) { if (in_array($key, array('created_at', 'modified_at'))) { return date::full_date_time(parent::__get($key)); } else { return parent::__get($key); } }
<th>Status</th> <th>Amount</th> <th>Notes</th> </tr> </thead> <tbody> <?php foreach ($orders as $order) { ?> <tr> <td><?php echo html::anchor($order->show_path(), '#' . $order); ?> </td> <td><?php echo date::full_date_time($order->created_at); ?> </td> <td><?php echo $order->status; ?> </td> <td><?php echo format::dollar_format($order->order_amount()); ?> </td> <td><?php echo $order->notes; ?> </td> </tr>
<?php if (frache::start('blog_entry_' . (string) $blog)) { ?> <div class="journal_entry"> <div class="journal_meta"> <?php echo html::anchor($blog->show_path(), $blog->title); ?> <span class="the_time"><?php echo date::full_date_time($blog->created_at); ?> </span> </div> <div class="journal_entry_content"> <?php echo nl2br($blog->content); ?> </div> </div> <?php frache::stop(); }
<div class="journal_entry"> <div class="journal_meta"> <?php echo html::anchor($journal->show_path(), $journal->title); ?> <span class="edit_journal_link"><?php echo html::anchor($journal->edit_path(), '(Edit)'); ?> </span> <span class="the_time"><?php echo date::full_date_time($journal->created_at); ?> </span> </div> <div class="journal_entry_content"> <?php echo nl2br($journal->content); ?> </div> </div>
<h4>Order History</h4> <table> <thead> <tr> <th>Time</th> <th>Status</th> </tr> </thead> <tbody> <?php foreach ($order->order_histories as $history) { ?> <tr> <td><?php echo date::full_date_time($history->created_at); ?> </td> <td><?php echo $history->status; ?> </td> </tr> <?php } ?> </tbody> </table> <div id="order_billing_shipping"> <address>