#1 2017-04-08 19:13:27

velissariouc
Member
Registered: 2016-10-31
Posts: 6

views in subfolders

Hi, In an a MVC application, like sample 30, is it possible to split the views in sub-folders?

Offline

#2 2017-04-09 14:48:05

velissariouc
Member
Registered: 2016-10-31
Posts: 6

Re: views in subfolders

One way I found to separate code and views according to functionality is to create more than one TMVCApplication descendants.
Let's say that in sample 30, we want to separate the functionality and the views about authors.
I created a new unit: MVCAuthorViewModel and I declared the type: TAuthorModule = class(TMVCApplication,IAuthorModule).
An instance of this type is created in the program file MVCServer like this:
      aApplication := TBlogApplication.Create;
      aAuthorModule:= TAuthorModule.Create;
You can see my sample at https://github.com/velissariouc/mormot- … 0-modified
Could some of the experienced mormot users have a look at my sample and tell if this is the right way?

Offline

Board footer

Powered by FluxBB