Our first example plug-in will be used to dynamically build a table containing the days of a particular month, just like what you would see if you opened your existing calendar application, like Microsoft Outlook, iCal, or Evolution. You should be able to specify what month and year you want from the template file, but if those parameters are not used, the current month and year will be used instead.
After running our calendar plug-in we expect the following output:
If possible the plug-in should be as simple to use as calling the function like:
{calendar month=4 year=2005}
As described before, if the month
and year
parameters are not provided, the current date will be used instead.
So to get that far, let’s first create the PHP script and Smarty template that will be used to call our plug-in.
Create a new PHP script called example_calendar.php
and put the following content in it:
<?php include_once(‘libs/Smarty.class.php’); $smarty = new Smarty; $smarty->display...