Saturday, March 28, 2009

Zodiac Sign Helper Class for CakePHP

Saturday, March 28, 2009
This is a simple Helper class for CakePHP that determines what is the zodiacal sign that corresponds to a given date or datetime string.

Releases:

  • Major version released. 1.0.0.0 (New!)

Requirements:

  • CakePHP 1.2 (not tested with CakePHP 1.1.x.x)
  • PHP versions 4 and 5

Licese:

Download:

Installation:

Example Usage:

In your view, just call the ZodiacSignHelper::name(). The passed argument must be a valid date or datetime string. And you will get a Sun zodiac sign such as Virgo, Leo and Sagittarius:

echo $zodiacSign->name($data['User']['birthday']);

You can also get a Chinese zodiac sign by setting the second parameter to 'Chinese'. The Chinese Zodiac consists of a 12-year cycle, each year of which is named after a different animal that imparts distinct characteristics of its year. For example, the year 2009 is the Year of the Ox:

echo $zodiacSign->name($data['User']['birthday'], 'Chinese');

0 comments:

Post a Comment

Please feel free to post your comment about this article.

 
JamNite ◄Design by Pocket, BlogBulk Blogger Templates