HMVC internal/external requests and routes?

Prolog

I think I understand the concept of HMVC after reading this question and answer https://softwareengineering.stackexchange.com/questions/220480/hmvc-and-database-connections; an extract from an answer is below:

Let's assume you want to have a view that enables a user to make a comment to a blog post. You would have fields for name, e-mail, title and comment, but you also want to have a field country displayed as a dropdown. In the action that displays this view you would make a database query that loads the countries and then populate that dropdown. Which is ok, but it forces you to duplicate the query and the view required to display the countries if you need it in another part of your application. A better approach would be to create separate controller for countries with an action that returns a view with the dropdown and then render that action whenever you need to show a list of countries.

What I cannot wrap my head around is that if I can internally request a controller/model/view which just displays a widget (e.g. a country select box), doesn't that mean that by accessing that url from a browser will also just show that view?

How is this managed in HMVC, are routes defined as internal/external only, so matching an internal route with an external request would show a 404 page?

Is this generally how it is done and is the HMVC description/definition above satisfiable with the general use case of it in most web applications?

Matthew

Showing the output of a sub-request in the browser shouldn't be a problem, so I wouldn't bother, especially that those URLs are not known by the user and it's safe to output the widgets separately.

Despite the above, you could, as @deceze mentionned, not attach those controllers to any routes. If you have a "default" route (matching all requests), then you would have to disable it.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Codeigniter HMVC to set up custom routes for modules

From Dev

Formatting routes for get requests

From Dev

How to setup routes for multidimensional requests?

From Dev

How to setup routes for multidimensional requests?

From Dev

Validating Requests for BundleConfig Routes/URLs

From Dev

Understanding how WebApi routes requests

From Dev

Same Rails 4 routes for GET and POST requests

From Dev

Clean up requests and callbacks when switching routes

From Dev

Same Rails 4 routes for GET and POST requests

From Dev

Is there a proxy webserver that routes dynamically requests based on URLs?

From Java

Can't perform POST requests in Laravel test for API routes

From Dev

Define HTTP routes to serve only "internal" requests with Spring Security

From Dev

Requests not able call multiple routes in same Flask application

From Dev

Route all requests, not matching other routes, to single action

From Dev

React - How to forward requests to routes that are not listed in the Router to a NotFound (404) component?

From Dev

How can I handle requests to routes that don't exist

From Dev

Python Requests library not working with Flask app own routes

From Dev

Laravel app routes incorrectly for mod_rewrite redirected requests

From Dev

User input validation in HMVC

From Dev

Laravel HMVC routing to controller

From Dev

Codeigniter & HMVC - Callback not working

From Dev

HMVC how to separate the modules?

From Dev

CodeIgniter +HMVC error

From Dev

How do I prevent my routes.rb from intercepting requests coming to /blog?

From Dev

How to prevent Laravel Routes from being accessed directly (i.e. non-ajax requests)

From Dev

How do I prevent my routes.rb from intercepting requests coming to /blog?

From Dev

Rails Routes only link_to only generating get requests rails 5

From Dev

Why HMVC instead of MVC for Codeigniter?

From Dev

Validation does not work on HMVC Codeigniter

Related Related

  1. 1

    Codeigniter HMVC to set up custom routes for modules

  2. 2

    Formatting routes for get requests

  3. 3

    How to setup routes for multidimensional requests?

  4. 4

    How to setup routes for multidimensional requests?

  5. 5

    Validating Requests for BundleConfig Routes/URLs

  6. 6

    Understanding how WebApi routes requests

  7. 7

    Same Rails 4 routes for GET and POST requests

  8. 8

    Clean up requests and callbacks when switching routes

  9. 9

    Same Rails 4 routes for GET and POST requests

  10. 10

    Is there a proxy webserver that routes dynamically requests based on URLs?

  11. 11

    Can't perform POST requests in Laravel test for API routes

  12. 12

    Define HTTP routes to serve only "internal" requests with Spring Security

  13. 13

    Requests not able call multiple routes in same Flask application

  14. 14

    Route all requests, not matching other routes, to single action

  15. 15

    React - How to forward requests to routes that are not listed in the Router to a NotFound (404) component?

  16. 16

    How can I handle requests to routes that don't exist

  17. 17

    Python Requests library not working with Flask app own routes

  18. 18

    Laravel app routes incorrectly for mod_rewrite redirected requests

  19. 19

    User input validation in HMVC

  20. 20

    Laravel HMVC routing to controller

  21. 21

    Codeigniter & HMVC - Callback not working

  22. 22

    HMVC how to separate the modules?

  23. 23

    CodeIgniter +HMVC error

  24. 24

    How do I prevent my routes.rb from intercepting requests coming to /blog?

  25. 25

    How to prevent Laravel Routes from being accessed directly (i.e. non-ajax requests)

  26. 26

    How do I prevent my routes.rb from intercepting requests coming to /blog?

  27. 27

    Rails Routes only link_to only generating get requests rails 5

  28. 28

    Why HMVC instead of MVC for Codeigniter?

  29. 29

    Validation does not work on HMVC Codeigniter

HotTag

Archive