Timeline for Redirect controller function on load, what function do I need to use?
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 20, 2021 at 10:51 | history | edited | Kuubs | CC BY-SA 4.0 |
added 263 characters in body
|
Dec 20, 2021 at 10:34 | history | edited | Kuubs | CC BY-SA 4.0 |
added 210 characters in body
|
Dec 11, 2021 at 21:00 | vote | accept | Kuubs | ||
Dec 11, 2021 at 6:17 | answer | added | Zollie | timeline score: 2 | |
Dec 9, 2021 at 15:14 | comment | added | Zollie | Great! I'll try to formulate a short, sensible answer on this. | |
Dec 9, 2021 at 14:57 | comment | added | Zollie |
I start to understand where you want to go with this. So, you have to override the display() method of this controller. So, you have to write your own display method in this controller where you can put your logic too and based on that, this method will not display the default View file of this controller but it will do whatever you want, especially redirect to somewhere else, if special conditions. Study the base controller Class of Joomla a bit to understand more the display() method of that.
|
|
Dec 9, 2021 at 14:22 | comment | added | Zollie | No, view.html.php is a View file (it belongs to the controller, it is true), do not be bothered by that. This controller file itself is almost empty because it inherits its methods from its parent Class(Controller) which it extends. So, put your custom methods in this Controller file(ControllerProfile). (You do not need construct). From this controller you can call the model where you can place your custom method too if needed. | |
Dec 9, 2021 at 5:04 | comment | added | Zollie | The question is not fully clear for me, but if the request arrives to this controller than this controller will forward “a request to the model” (to a method of that model) and based on the returned value, this controller will control whether it displays the view or redirect to somewhere else (to another view). Place the logic in the model (if it has anything to do with any data handling), and place the controller logic(decision) in the controller (in a new method if needed). | |
Dec 8, 2021 at 10:59 | history | asked | Kuubs | CC BY-SA 4.0 |