Function to forward controller action to another controller #199
Labels
No labels
bug
confirmed
critical
discussion
documentation
Doing
enhancement
experiment
suggestion
support
Testing
To Do
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: hazaar/framework#199
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I have a situation where, due to a poorly implemented MVC application, there is a lot of code in a controller action that needs to be used by another controller action. Due to the size of the code and the method by which it was implemented, it would require the entire action to be re-written using correct MVC techniques in order to create common code in a Model that can be used from the new action that requires similar functionality.
To get around this issue in a more simple way, I have come up with a plan to make it simple to call another controller (and action) from the requested action. This will setup the controller, including initialising it, call the action and transfer all view and view data back to the original controller which can then make any required modifications before returning a response.
This would be executed possibly such as:
This would forward a request to
/target/action
internally to/index/action
and then the target updates a view data parameter calledparameter
with a different value.mentioned in merge request !93
created merge request !93 to address this issue
closed via merge request !93
mentioned in commit 9f9fb3bf9204b304b7e82af8a066e7d7958e2e73