Simple PHP Calendar

Simple PHP Calendar is a a simple, extensible PHP calendar class.
Download

Simple PHP Calendar Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Oscar Merida
  • Publisher web site:
  • http://www.oscarm.org/page/calendarClass/

Simple PHP Calendar Tags


Simple PHP Calendar Description

Simple PHP Calendar is a a simple, extensible PHP calendar class. Simple PHP Calendar is a a simple, extensible PHP calendar class. The project focuses exclusively on generating an HTML representation for a given month. It is meant to be easily extended for use in other applications, such as input widgets for forms, or full event calendaring applications. Its output is completely customizable via CSS.A simple exampleAfter downloading the class and including it in your PHP script, you're ready to start using it. The constructor requires two paramets, a year and month. The following code produces a very plain looking calendar.1 require_once( 'class.Calendar.php' ); 2 $cal = new Calendar ('2004', '3' ); 3 echo "".$cal->getFullMonthName().""; 4 echo $cal->display(); Customizing the displayYou can use two methods to change how the calendar is displayed. Use setTableWidth to define how wide to make the table, in pixels or as a percentage of the screen. Use setDayNameFormat to change how weekdays are displayed in the header row using strftime formats.1 require_once('class.Calendar.php'); 2 $calendar = new Calendar ('2004', '4'); 3 $calendar->setTableWidth('50%'); 4 $calendar->setDayNameFormat('%A'); 5 echo "".$calendar->getBriefMonthName().'"; 6 echo $calendar->display(); Final ExampleYou can use CSS selectors to control the formatting of all aspects of the calendar, including adding borders and how empty boxes display. Lets wrap our talbe in a div named calendar and use the following styles. /* overall table */ #calendar table { border:1px solid #fff; padding: 0; margin:20px; } /* the day headers across the top */ #calendar th { background: #565; color: #fff; margin: 3px; padding: 2px 5px; } /* how days this month will look, make dates appear in top right */ #calendar td { background: #eee; color: #000; padding: 2px; margin:0; height:60px; text-align:right; vertical-align:top; border:1px solid #fff; } /* these are the days falling outside this month */ #calendar td.notInMonth { background: #999; }What's New in This Release:· The documentation has been polished.· An example has been added for extending the class to customize how a calendar grid will display.


Simple PHP Calendar Related Software