| Line | |
|---|
| 1 | <?php |
|---|
| 2 | /** |
|---|
| 3 | * Description: demonstrates using the Uri decorator |
|---|
| 4 | */ |
|---|
| 5 | if (!@include 'Calendar/Calendar.php') { |
|---|
| 6 | define('CALENDAR_ROOT', '../../'); |
|---|
| 7 | } |
|---|
| 8 | require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|---|
| 9 | require_once CALENDAR_ROOT.'Decorator/Uri.php'; |
|---|
| 10 | |
|---|
| 11 | if (!isset($_GET['jahr'])) $_GET['jahr'] = date('Y'); |
|---|
| 12 | if (!isset($_GET['monat'])) $_GET['monat'] = date('m'); |
|---|
| 13 | |
|---|
| 14 | // Build the month |
|---|
| 15 | $Calendar = new Calendar_Month_Weekdays($_GET['jahr'], $_GET['monat']); |
|---|
| 16 | |
|---|
| 17 | echo ( '<p>The current month is ' |
|---|
| 18 | .$Calendar->thisMonth().' of year '.$Calendar->thisYear().'</p>'); |
|---|
| 19 | |
|---|
| 20 | $Uri = & new Calendar_Decorator_Uri($Calendar); |
|---|
| 21 | $Uri->setFragments('jahr','monat'); |
|---|
| 22 | // $Uri->setSeperator('/'); // Default is & |
|---|
| 23 | // $Uri->setScalar(); // Omit variable names |
|---|
| 24 | echo ( "<pre>Previous Uri:\t".$Uri->prev('month')."\n" ); |
|---|
| 25 | echo ( "This Uri:\t".$Uri->this('month')."\n" ); |
|---|
| 26 | echo ( "Next Uri:\t".$Uri->next('month')."\n</pre>" ); |
|---|
| 27 | ?> |
|---|
| 28 | <p> |
|---|
| 29 | <a href="<?php echo($_SERVER['PHP_SELF'].'?'.$Uri->prev('month'));?>">Prev</a> : |
|---|
| 30 | <a href="<?php echo($_SERVER['PHP_SELF'].'?'.$Uri->next('month'));?>">Next</a> |
|---|
| 31 | </p> |
|---|
Note: See
TracBrowser
for help on using the repository browser.