dmWidgetEventCalendarPlugin displays the days in from the current month in a list. You can attach events to each day and they will be displayed on the calendar. Events can be populated into the calendar from a model's records if the model implements the provided interface.
Run in project's directory:
git clone git://github.com/antitoxic/dmWidgetEventCalendarPlugin.git plugins/dmWidgetEventCalendarPlugin
Edit ProjectConfiguration
class ProjectConfiguration extends dmProjectConfiguration
{
public function setup()
{
parent::setup();
$this->enablePlugins(array(
// your enabled plugins
'dmWidgetEventCalendarPlugin'
));
Run in project's directory:
php symfony cc
Include the plugin assets in your apps/front/config/view.yml
file:
stylesheets:
- dmWidgetEventCalendarPlugin.view
Don't forget to publish the plugins' assets:
php symfony dm:publish-assets
It includes:
event_calendar
service. Universally reach it via dmContext::getInstance()->getServiceContainer()->getService('event_calendar')
Offers dmHtmlCalendarEventInterface
that your model should implement in
order to be valid Event for the calendar.
Only the following methods should be defined:
($day, $isFirstEvent=true)
Used to output the event($startDate, $endDate)
STATIC You can simply
define empty method. Otherwise it should be a Doctrine_Query
instance.'EE'
(Single letter)
| 'EEE'
(Abbreviated) | 'EEE'
(Full name)dmHtmlCalendarEventInterface
interface.
The model's table will be queried to retrieve events from the current month.Here is the minimum if you want Events to be populated into the calendar from a model's records:
class Appointment extends BaseAppointment implements dmHtmlCalendarEventInterface
{
public function getAdditionalDayAttributes()
{
}
public function getAdditionalDayClasses()
{
}
public function renderEvent( $day , $isFirstEvent = true )
{
return $day.' '.$this->getClient();
}
public function getCalendarDate()
{
return $this->getScheduledOn();
}
public static function getCalendarDateColumnName()
{
return 'scheduled_on';
}
public static function getCalendarQuery($startDate, $endDate) {
}
}