Skip to content

Commit

Permalink
Improved sample about https://pastebin.com/RVAKR8VU
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleteti committed Feb 11, 2020
1 parent c36cd13 commit 8b46dfc
Show file tree
Hide file tree
Showing 10 changed files with 1,013 additions and 245 deletions.
239 changes: 0 additions & 239 deletions samples/activerecord_crud/activerecord_crud.dproj

This file was deleted.

File renamed without changes.
33 changes: 33 additions & 0 deletions samples/activerecord_restful_crud/OtherControllerU.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
unit OtherControllerU;

interface

uses
MVCFramework, MVCFramework.Commons;

type
TOtherController = class(TMVCController)
public
[MVCPath]
[MVCHTTPMethods([httpGET])]
procedure GetSomethings;
[MVCPath('/else')]
[MVCHTTPMethods([httpGET])]
procedure GetSomethingElse;
end;

implementation

{ TCustomController }

procedure TOtherController.GetSomethingElse;
begin
Render('Hello There, it''s "GetSomethingElse" here');
end;

procedure TOtherController.GetSomethings;
begin
Render('Hello There, it''s "GetSomethings" here');
end;

end.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ implementation
MVCFramework.Commons,
MVCFramework.ActiveRecordController,
MVCFramework.ActiveRecord,
FDConnectionConfigU;
FDConnectionConfigU, CustomControllerU, OtherControllerU;

procedure TMyWebModule.WebModuleCreate(Sender: TObject);
begin
Expand All @@ -79,6 +79,8 @@ procedure TMyWebModule.WebModuleCreate(Sender: TObject);
// Define a default URL for requests that don't map to a route or a file (useful for client side web app)
Config[TMVCConfigKey.FallbackResource] := 'index.html';
end);

FMVC.AddController(TOtherController, '/api/foo');
FMVC.AddController(TMVCActiveRecordController,
function: TMVCController
begin
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
program activerecord_crud;
program activerecord_restful_crud;

{$APPTYPE CONSOLE}

Expand All @@ -19,13 +19,13 @@ uses
MVCFramework.SQLGenerators.Interbase,
MVCFramework.SQLGenerators.MSSQL,
MVCFramework.SQLGenerators.MySQL,
WebModuleU in 'WebModuleU.pas' {MyWebModule: TWebModule} ,
WebModuleU in 'WebModuleU.pas' {MyWebModule: TWebModule},
Entities in 'Entities.pas',
MVCFramework.ActiveRecordController
in '..\..\sources\MVCFramework.ActiveRecordController.pas',
MVCFramework.ActiveRecordController in '..\..\sources\MVCFramework.ActiveRecordController.pas',
MVCFramework.ActiveRecord in '..\..\sources\MVCFramework.ActiveRecord.pas',
EntitiesProcessors in 'EntitiesProcessors.pas',
FDConnectionConfigU in '..\activerecord_showcase\FDConnectionConfigU.pas';
FDConnectionConfigU in '..\activerecord_showcase\FDConnectionConfigU.pas',
OtherControllerU in 'OtherControllerU.pas';

{$R *.res}

Expand Down
972 changes: 972 additions & 0 deletions samples/activerecord_restful_crud/activerecord_restful_crud.dproj

Large diffs are not rendered by default.

0 comments on commit 8b46dfc

Please sign in to comment.