I'm trying to override a function using the new override method. I've been able to override front-end controllers, but I'm having trouble with a back-end override.
I'm attempting to implement support for a backend custom.css file, and it works in the core controller.php file just fine.
Here's the code that I have placed in /administrator/components/com_eventbooking/controller/override/controller.php with my additions annotated between the BEGIN-and END JAMES ADD tags:
Code:
<?php
class EventbookingControllerOverride extends EventbookingController
{
public function display($cachable = false, array $urlparams = array())
{
JFactory::getDocument()->addStyleSheet(JUri::base(true) . '/components/com_eventbooking/assets/css/style.css');
/* ********** BEGIN JAMES ADD 11/03/2016 ******************** */
if (file_exists(JPATH_ROOT . '/administrator/components/com_eventbooking/assets/css/custom.css') && filesize(JPATH_ROOT . '/administrator/components/com_eventbooking/assets/css/custom.css') > 0 )
{
JFactory::getDocument()->addStyleSheet(JUri::base(true) . '/components/com_eventbooking/assets/css/custom.css');
}
/* ********** END JAMES ADD 11/03/2016 ******************** */
parent::display($cachable, $urlparams);
if ($this->input->getCmd('format', 'html') != 'raw')
{
EventbookingHelper::displayCopyRight();
}
}
}
?>
Can I not override this function? Am I doing something wrong? Or are overrides not implemented for the back-end component yet?