Calendar
[ class tree: Calendar ] [ index: Calendar ] [ all elements ]

Source for file 18.php

Documentation is available at 18.php

  1. <?php
  2. /**
  3. * Description: demonstrates using the Wrapper decorator
  4. */
  5.  
  6. if (!@include 'Calendar/Calendar.php'{
  7.     define('CALENDAR_ROOT''../../');
  8. }
  9. require_once CALENDAR_ROOT.'Month.php';
  10. require_once CALENDAR_ROOT.'Decorator.php'// Not really needed but added to help this make sense
  11. require_once CALENDAR_ROOT.'Decorator/Wrapper.php';
  12.  
  13. {
  14.     function MyBoldDecorator(&$Calendar)
  15.     {
  16.         parent::Calendar_Decorator($Calendar);
  17.     }
  18.  
  19.     function thisDay()
  20.     {
  21.         return '<b>'.parent::thisDay().'</b>';
  22.     }
  23. }
  24.  
  25. $Month = new Calendar_Month(date('Y')date('n'));
  26.  
  27. $Wrapper new Calendar_Decorator_Wrapper($Month);
  28. $Wrapper->build();
  29.  
  30. echo '<h2>The Wrapper decorator</h2>';
  31. echo '<i>Day numbers are rendered in bold</i><br /> <br />';
  32. while ($DecoratedDay $Wrapper->fetch('MyBoldDecorator')) {
  33.     echo $DecoratedDay->thisDay().'<br />';
  34. }
  35. ?>

Documentation generated on Mon, 11 Mar 2019 15:37:47 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.