delphimvcframework/samples/renders/WebModuleU.pas

44 lines
1.1 KiB
ObjectPascal
Raw Normal View History

2013-11-10 01:03:53 +01:00
unit WebModuleU;
interface
uses
System.SysUtils, System.Classes,
Web.HTTPApp, MVCFramework, FireDAC.Stan.Intf, FireDAC.Stan.Option,
FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def,
FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.Stan.Param,
FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt, Data.DB, FireDAC.Comp.DataSet,
2016-02-26 19:21:57 +01:00
FireDAC.Comp.Client, FireDAC.Phys.IBBase, FireDAC.Phys.IB, FireDAC.Phys.FB,
FireDAC.Phys.FBDef, FireDAC.VCLUI.Wait;
2013-11-10 01:03:53 +01:00
type
TWebModule1 = class(TWebModule)
FDConnection1: TFDConnection;
qryCustomers: TFDQuery;
2014-03-06 14:20:57 +01:00
FDPhysFBDriverLink1: TFDPhysFBDriverLink;
2013-11-10 01:03:53 +01:00
procedure WebModuleCreate(Sender: TObject);
private
DMVC: TMVCEngine;
end;
var
WebModuleClass: TComponentClass = TWebModule1;
implementation
{$R *.dfm}
2016-02-26 19:21:57 +01:00
uses RenderSampleControllerU, MVCFramework.Commons;
2013-11-10 01:03:53 +01:00
procedure TWebModule1.WebModuleCreate(Sender: TObject);
begin
2016-02-26 19:21:57 +01:00
DMVC := TMVCEngine.Create(self,
procedure(Config: TMVCConfig)
begin
2016-02-27 09:58:54 +01:00
Config[TMVCConfigKey.ViewPath] := 'templates';
2016-02-26 19:21:57 +01:00
end);
2013-11-10 01:03:53 +01:00
DMVC.AddController(TRenderSampleController);
end;
end.