I'm following "How to change Joomla without Core Hacks"
Part #6 "Component with “own controller”"
https://www.jug010.nl/images/presentati ... ehacks.pdf
But, When I use my overridden form, the original controller executes, not my "own" controller. How to I get Joomla to use my "own" controller?
Below is what I have developed so far.
I have also put full copies of the 3 files on github, if you want to see the code, here: https://github.com/Kimball31/MassMail
I used the Joomla Create Template Overrides tools to override the /com_users/mail component.
That created the new file: /atum/html/com_users/mail/default.php
I made copies the controller and model, as unique filenames for my "own" controller and model.
The new files for that are:
/administrator/components/com_users/src/Model/MailIndividualModel.php
/administrator/components/com_users/src/Controller/MailIndividualController.php
I then update the "task" in the default.php form, and modified the class names and some of the methods in my "own" controller and module.
changed default.php:changed /src/Model/MailIndividualModel.php:Changed /src/Controller/MailIndividualController.phpI'm still missing something. The form does not execute the MailIndividualController.
Part #6 "Component with “own controller”"
https://www.jug010.nl/images/presentati ... ehacks.pdf
But, When I use my overridden form, the original controller executes, not my "own" controller. How to I get Joomla to use my "own" controller?
Below is what I have developed so far.
I have also put full copies of the 3 files on github, if you want to see the code, here: https://github.com/Kimball31/MassMail
I used the Joomla Create Template Overrides tools to override the /com_users/mail component.
That created the new file: /atum/html/com_users/mail/default.php
I made copies the controller and model, as unique filenames for my "own" controller and model.
The new files for that are:
/administrator/components/com_users/src/Model/MailIndividualModel.php
/administrator/components/com_users/src/Controller/MailIndividualController.php
I then update the "task" in the default.php form, and modified the class names and some of the methods in my "own" controller and module.
changed default.php:
Code:
//from: <input type="hidden" name="task" value="">//to:<input type="hidden" name="task" value="MailIndividual">
Code:
//from:class MailModel extends AdminModel//to:class MailIndividualModel extends AdminModel
Code:
//from:class MailController extends BaseController//to:class MailIndividualController extends BaseController
Statistics: Posted by Kimball31 — Mon Mar 11, 2024 6:21 pm