# Overriding Calendar export class

**URL:** <https://forums.concretecms.org/t/overriding-calendar-export-class/8841>\
**Category:** Developing with Concrete\
**Created:** [March 4, 2025, 7:42pm UTC](https://forums.concretecms.org/t/overriding-calendar-export-class/8841 "2025-03-04T19:42:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doki](https://forums.concretecms.org/user_avatar/forums.concretecms.org/doki/32/5233_2.png) [@Doki](https://forums.concretecms.org/u/Doki)\
**Post date:** [March 4, 2025, 7:42pm UTC](https://forums.concretecms.org/t/overriding-calendar-export-class/8841/1 "2025-03-04T19:42:12Z")

</div>

Hi all,

I’m currently trying to override the calendar export class (old Outlook doesn’t recognize daylight savings when drag-and-dropping .ics files int old outook, offsetting calendar times by an hour). To do this, I need to add the VTIMEZONE block at the top of the generated .ics file. Easy enough by adding some extra code to the concrete/controllers/event/export.php file.

Of course, I don’t want to overwrite base concrete code, so I made a copy of the file in applications/controllers/event/export.php, changing the namespace from:

namespace Concrete\Controller\Event;

to

namespace Application\Controller\Event;

Then, to complete the override, I went into applications/bootstrap/app.php and added the following to the bottom of the comment block (as per the instructions in app.php):

Core::bind(‘\Concrete\Controller\Event\Export’, function($app, $params) {  
return new \Application\Controller\Event\Export($params[0]);  
});

Doing the above, my new code isn’t overriding the old code. Anyone know what I’m doing wrong?

---

<div class="post-metadata">

**Author:** ![mnakalay](https://forums.concretecms.org/user_avatar/forums.concretecms.org/mnakalay/32/6336_2.png) [@mnakalay](https://forums.concretecms.org/u/mnakalay)\
**Post date:** [March 5, 2025, 4:50pm UTC](https://forums.concretecms.org/t/overriding-calendar-export-class/8841/2 "2025-03-05T16:50:35Z")

</div>

> [@Doki](#):
>
> applications

Hello.  
So first i’m assuming you added your code to the application folder (no “s”) and not applicationS like you wrote?

Try this instead:

```auto
$app->bind('\Concrete\Controller\Event\Export', '\Application\Controller\Event\Export'
);

```

---

<div class="post-metadata">

**Author:** ![Doki](https://forums.concretecms.org/user_avatar/forums.concretecms.org/doki/32/5233_2.png) [@Doki](https://forums.concretecms.org/u/Doki)\
**Post date:** [March 5, 2025, 5:39pm UTC](https://forums.concretecms.org/t/overriding-calendar-export-class/8841/3 "2025-03-05T17:39:49Z")

</div>

> [@mnakalay](#):
>
> ```auto
> $app->bind('\Concrete\Controller\Event\Export', '\Application\Controller\Event\Export'
> );
> 
> ```

Thanks for taking the time to reply!

I am using “application” singular. 🙂

Tried the new binding method you suggested (adding it to bootstrap/app.js), unfortunately its also not working.

I think the problem is that we’re generating .ics files using a direct link on our events pages, with the links following this pattern:

%%our site%%/ccm/calendar/event/export?eventID=301

I don’t think the override above is working for these types of generated links. That’s my current theory at least…

---

<div class="post-metadata">

**Author:** ![Doki](https://forums.concretecms.org/user_avatar/forums.concretecms.org/doki/32/5233_2.png) [@Doki](https://forums.concretecms.org/u/Doki)\
**Post date:** [March 5, 2025, 5:49pm UTC](https://forums.concretecms.org/t/overriding-calendar-export-class/8841/4 "2025-03-05T17:49:12Z")

</div>

I see in concrete/routes/calendar.php:

$router-\>all(‘/ccm/calendar/event/export’, ‘\Concrete\Controller\Event\Export::export’);

I wonder if I have to override this manually…

---

<div class="post-metadata">

**Author:** ![Doki](https://forums.concretecms.org/user_avatar/forums.concretecms.org/doki/32/5233_2.png) [@Doki](https://forums.concretecms.org/u/Doki)\
**Post date:** [March 5, 2025, 5:56pm UTC](https://forums.concretecms.org/t/overriding-calendar-export-class/8841/5 "2025-03-05T17:56:30Z")

</div>

GOT IT!

What I needed to do was add to application/bootstrap/app.php:

$router = $app-\>make(‘router’);  
$router-\>all(‘/ccm/calendar/event/export’, ‘\Application\Controller\Event\Export::export’);

That did it! Thanks for your help on this! You pointed me in the right direction.

---

<div class="post-metadata">

**Author:** ![mnakalay](https://forums.concretecms.org/user_avatar/forums.concretecms.org/mnakalay/32/6336_2.png) [@mnakalay](https://forums.concretecms.org/u/mnakalay)\
**Post date:** [March 5, 2025, 7:35pm UTC](https://forums.concretecms.org/t/overriding-calendar-export-class/8841/6 "2025-03-05T19:35:21Z")

</div>

Glad you figured it out.  
Still, I’m surprised the overridden class doesn’t get called when the route is used. Technically the container should instantiate the class and hence use the override…

Oh well, I’m probably missing something…
