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?
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…