Override administrator controller/controller.php
- James Riley
-
Topic Author
- Offline
- Platinum Member
-
Less
More
8 years 5 months ago - 8 years 5 months ago #89617
by James Riley
James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Override administrator controller/controller.php was created by James Riley
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:
Can I not override this function? Am I doing something wrong? Or are overrides not implemented for the back-end component yet?
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?
James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Last edit: 8 years 5 months ago by James Riley.
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
8 years 5 months ago #89640
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Override administrator controller/controller.php
Hi James
The class name is not correct. It should be EventbookingControllerOverrideController
Regards,
Tuan
The class name is not correct. It should be EventbookingControllerOverrideController
Regards,
Tuan
Please Log in or Create an account to join the conversation.
- James Riley
-
Topic Author
- Offline
- Platinum Member
-
8 years 5 months ago #89757
by James Riley
James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Replied by James Riley on topic Override administrator controller/controller.php
Ahhh... It works now
Thanks, Tuan.
So, with overrides, if you are overriding the a "root" EventbookingController or a EventbookingHelper, etc., class, you need to add "OverrideController" or "OverrideHelper" to the end of the new override class, and not insert "Override" as you would in the case other classes.
Example:

So, with overrides, if you are overriding the a "root" EventbookingController or a EventbookingHelper, etc., class, you need to add "OverrideController" or "OverrideHelper" to the end of the new override class, and not insert "Override" as you would in the case other classes.
Example:
- EventbookingController -> EventbookingControllerOverrideController
- EventbookingControllerRegister -> EventbookingControllerOverrideRegister
James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
8 years 5 months ago #89785
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Override administrator controller/controller.php
OK James. I will update documentation when I have some free time. Right now, still too busy
Tuan
Tuan
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.