BC or AD – a zend view helper

September 24th, 2008 by daniel pett

Apologies for the lack of posting on the blogs recently. I’m currently engaged in rebuilding the Scheme database to make it more usable and also more joined up. This is going to take a while and I’m using Zend Framework as the base. I think I should share some code and here’s a view helper for changing negative integers to a BC date and positive integers to an AD date. The class is shown below:


< ?php
class DEJP_View_Helper_ADBC
{
public function ADBC($string="", $suffix="BC", $prefix="AD")
{

if ($string  

And it would be used as such within your view script:


ADBC($table->field);?>

If I create anymore that might be useful, I’ll add them.

2 Comments »

  1. BCE and CE, surely? ;)

    Comment by Andrew Larcombe — September 24, 2008 @ 11:55 pm

  2. I don’t go for that :)

    Comment by Daniel Pett — September 25, 2008 @ 8:02 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

The content contained within the Blog's pages do not represent an official position from any of the organisations associated with the Portable Antiquities Scheme. They are solely those of the post's author.