Base solution for your next web application
Open Closed

Convention for MVC Controllers and views from a plugin? #2480


User avatar
0
rbarbosa created

Hi

I was wondering if there are set conventions when using views from a plugin, my intention is to create each menu item as a plugin, menu registration works great, but there is no such mechanism to map the routes to the modules, or is it? So far I put the controllers and views in the same folder name structure as the main project, also added the PreStarter class from the documentation : ABP.Web

  • Areas\Mpa [list:22z4hnjc][*:22z4hnjc]Controllers
  • Views[/*:m:22z4hnjc][/list:u:22z4hnjc]

Plugin.Web

  • Areas\Mpa [list:22z4hnjc][*:22z4hnjc]Controllers > Home
  • Views > Index[/*:m:22z4hnjc][/list:u:22z4hnjc]

Do i have to write a Route manager that will inject every plugin route to the Routecollection on load? ideally as /module/something I was hoping to keep it as lean as possible to maintain compatibility with the ABP project. Thanks, Rodrigo


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    We didn't make any special work for conventions. It should work as expected for default MVC convention.

  • User Avatar
    0
    rbarbosa created

    Do you have any examples of a hello world style controller/view/routes that comes from a module?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Currently we don't have an example but we are thinking to create one.