[TYPO3-calendar] Use of a cal service
Chris Müller
mueller at cyperfection.de
Mon Oct 22 10:14:57 CEST 2012
Hi Mario,
thanks for your answer. I tried to use it but got into errors. My code:
$calApi = t3lib_div::makeInstance('tx_cal_api');
$calApi = &$calApi->tx_cal_api_without($GLOBALS['TSFE']->id);
$events = $calApi->searchEvents();
With searchEvents() I got the error:
PHP Fatal error: Call to a member function subtractSeconds() on a
non-object in
[...]/htdocs/typo3conf/ext/cal/service/class.tx_cal_event_service.php on
line 1300
I tried some different methods and got also errors:
$events = $calApi->findEventsWithin(time(), time()+365*86400);
The same error as above.
$events = $calApi->findEvent(5, 0);
PHP Fatal error: Call to a member function versionOL() on a non-object
in
[...]/typo3_src-4.7.5/typo3/sysext/cms/tslib/content/class.tslib_content_content.php
on line 114
Do you have an idea how to handle this error or a working example?
I also need the next events dependend on categories. I didn't found a
method in the API for that.
Regards,
Chris.
Am 21.10.2012 21:01, schrieb Mario Matzulla:> Hi Chris,
>
> the easiest way to integrate cal is to use its api:
>
> $tx_cal_api = t3lib_div::makeInstance('tx_cal_api');
> $tx_cal_api = &$tx_cal_api->tx_cal_api_without($pageIDForPlugin);
>
> // $pageIDForPlugin is a page containing the TS for cal
>
> The tx_cal_api class is located in the controller folder.
>
> Regards,
> Mario
More information about the TYPO3-project-calendar
mailing list