Skip to content

Commit

Permalink
Merge branch 'master' into features_websockets2025
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleteti committed Feb 14, 2025
2 parents cbed4f7 + 7bf672b commit 127bb7f
Show file tree
Hide file tree
Showing 121 changed files with 93 additions and 13,404 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# DelphiMVCFramework ![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg) ![GitHub All Releases](https://img.shields.io/github/downloads/danieleteti/delphimvcframework/total?label=Downloads)

![](https://img.shields.io/badge/stable-dmvcframework--3.4.1--sodium-blue)
![](https://img.shields.io/badge/beta-dmvcframework--3.4.2--magnesium--rc4-red)
![](https://img.shields.io/badge/stable-dmvcframework--3.4.2--magnesium-blue)
![](https://img.shields.io/badge/beta-dmvcframework--3.4.3--aluminium--dev)

## 📍 [Help DMVCFramework and your business! Click Here to access premium contents!](https://www.patreon.com/bePatron?u=72182967)

Expand All @@ -24,9 +24,9 @@
- [How to partecipate to DMVCFramework development and/or tests](#how-to-partecipate-to-dmvcframework-development-andor-tests)
- [Sponsors](#sponsors)
- [What users say about DMVCFramework](#what-users-say-about-dmvcframework)
- [What's New in DMVCFramework-3.4.2-magnesium-rc2 (release candidate 2 version)](#whats-new-in-dmvcframework-342-magnesium-rc2-release-candidate-2-version)
- [What's New in DMVCFramework-3.4.1-sodium (stable version)](#whats-new-in-dmvcframework-341-sodium-stable-version)
- [What's New in DMVCFramework-3.4.2-magnesium (stable version)](#whats-new-in-dmvcframework-342-magnesium-stable-version)
- [Older Versions](#older-versions)
- [What's New in DMVCFramework-3.4.1-sodium](#whats-new-in-dmvcframework-341-sodium)
- [What's New in DMVCFramework-3.4.0-neon](#whats-new-in-dmvcframework-340-neon)
- [What's New in DMVCFramework-3.3.0-fluorine](#whats-new-in-dmvcframework-330-fluorine)
- [What's New in DMVCFramework-3.2.3-radium](#whats-new-in-dmvcframework-323-radium)
Expand Down Expand Up @@ -225,16 +225,17 @@ Congratulations to Daniele Teti and all the staff for the excellent work!" -- Ma
> "I managed to generate an API for my application thanks to this framework, it is truly useful and efficient!" -- J. Urbani

## What's New in DMVCFramework-3.4.2-magnesium-rc2 (release candidate 2 version)
## What's New in DMVCFramework-3.4.2-magnesium (stable version)
>👉 A deep analisys of what's new in DelphiMVCFramework-3.4.2-magnesium is available on [Daniele Teti Blog]
https://www.danieleteti.it/post/delphimvcframework-3-4-2-magnesium/

## What's New in DMVCFramework-3.4.1-sodium (stable version)

## Older Versions

### What's New in DMVCFramework-3.4.1-sodium

>👉 A deep analisys of what's new in DelphiMVCFramework-3.4.1-sodium is available on [Daniele Teti Blog](https://www.danieleteti.it/post/delphimvcframework-3-4-1-sodium/) 👈

## Older Versions

### What's New in DMVCFramework-3.4.0-neon

Expand Down
18 changes: 8 additions & 10 deletions ideexpert/DMVC.Expert.Forms.NewProjectWizard.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ object frmDMVCNewProject: TfrmDMVCNewProject
end
object lblWbModule: TLabel
Left = 24
Top = 167
Top = 163
Width = 114
Height = 13
Caption = 'WebModule Class Name'
end
object Label2: TLabel
Left = 24
Top = 214
Top = 210
Width = 55
Height = 13
Caption = 'Server Port'
Expand Down Expand Up @@ -492,14 +492,14 @@ object frmDMVCNewProject: TfrmDMVCNewProject
end
object edtWebModuleName: TEdit
Left = 24
Top = 186
Top = 182
Width = 225
Height = 21
TabOrder = 1
end
object edtServerPort: TEdit
Left = 24
Top = 233
Top = 229
Width = 65
Height = 21
TabOrder = 2
Expand Down Expand Up @@ -751,7 +751,7 @@ object frmDMVCNewProject: TfrmDMVCNewProject
end
object chkMSHeap: TCheckBox
Left = 24
Top = 283
Top = 303
Width = 225
Height = 17
Anchors = [akLeft, akRight, akBottom]
Expand All @@ -760,7 +760,7 @@ object frmDMVCNewProject: TfrmDMVCNewProject
end
object chkCustomConfigDotEnv: TCheckBox
Left = 24
Top = 264
Top = 325
Width = 225
Height = 17
Anchors = [akLeft, akRight, akBottom]
Expand All @@ -769,7 +769,7 @@ object frmDMVCNewProject: TfrmDMVCNewProject
end
object chkServicesContainer: TCheckBox
Left = 24
Top = 303
Top = 259
Width = 225
Height = 17
Anchors = [akLeft, akRight, akBottom]
Expand All @@ -780,13 +780,11 @@ object frmDMVCNewProject: TfrmDMVCNewProject
end
object chkSqids: TCheckBox
Left = 24
Top = 323
Top = 281
Width = 225
Height = 17
Anchors = [akLeft, akRight, akBottom]
Caption = 'Use Sqids'
Checked = True
State = cbChecked
TabOrder = 11
end
object rgNameCase: TRadioGroup
Expand Down
2 changes: 1 addition & 1 deletion ideexpert/DMVC.Expert.Forms.NewProjectWizard.pas
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ procedure TfrmDMVCNewProject.rgSSVClick(Sender: TObject);
{$if not Defined(WEBSTENCILS)}
if SameText(rgSSV.Items[rgSSV.ItemIndex], 'webstencils') then
begin
ShowMessage('This Delphi version doesn''t support WebStencils, so DMVCFramework cannot use it.' +
ShowMessage('This Delphi version doesn''t support WebStencils, so DelphiMVCFramework cannot use it.' +
sLineBreak + 'Consider to use TemplatePro.');
rgSSV.ItemIndex := 1;
end;
Expand Down
2 changes: 1 addition & 1 deletion ideexpert/DMVC.Expert.NewUnitWizardEx.pas
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class procedure TDMVCNewUnitWizard.RegisterDMVCNewUnitWizard(const APersonality:
begin
RegisterPackageWizard(TExpertsRepositoryProjectWizardWithProc.Create(APersonality, sNewDMVCProjectHint,
sNewDMVCUnitCaption, 'DMVC.Wizard.NewUnitWizard', // do not localize
'DMVCFramework', 'DMVCFramework Team - https://github.com/danieleteti/delphimvcframework', // do not localize
'DelphiMVCFramework', 'DelphiMVCFramework Team - https://github.com/danieleteti/delphimvcframework', // do not localize
procedure
var
WizardForm: TfrmDMVCNewUnit;
Expand Down
2 changes: 1 addition & 1 deletion ideexpert/DMVC.Expert.ProjectWizardEx.pas
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class procedure TDMVCNewProjectWizard.RegisterDMVCProjectWizard(const APersonali
begin
RegisterPackageWizard(TExpertsRepositoryProjectWizardWithProc.Create(APersonality, sNewDMVCProjectHint, sNewDMVCProjectCaption,
'DMVC.Wizard.NewProjectWizard', // do not localize
'DMVCFramework', 'DMVCFramework Team - https://github.com/danieleteti/delphimvcframework', // do not localize
'DelphiMVCFramework', 'DelphiMVCFramework Team - https://github.com/danieleteti/delphimvcframework', // do not localize
procedure
var
WizardForm: TfrmDMVCNewProject;
Expand Down
2 changes: 0 additions & 2 deletions samples/activerecord_restful_crud/WebModuleU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ procedure TMyWebModule.WebModuleCreate(Sender: TObject);
FMVC := TMVCEngine.Create(Self,
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';
// default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
// default content charset
Expand Down
2 changes: 0 additions & 2 deletions samples/angular/server/WebModuleU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ procedure TMyWebModule.WebModuleCreate(Sender: TObject);
FMVC := TMVCEngine.Create(Self,
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';
// default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
// default content charset
Expand Down
2 changes: 0 additions & 2 deletions samples/avoid_mid_air_collisions_sample/WebModuleU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ procedure TMyWebModule.WebModuleCreate(Sender: TObject);
FMVC := TMVCEngine.Create(Self,
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';
//default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
//default content charset
Expand Down
1 change: 0 additions & 1 deletion samples/custom_auth/MyWebModuleU.dfm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
object MyWebModule: TMyWebModule
OldCreateOrder = False
OnCreate = WebModuleCreate
OnDestroy = WebModuleDestroy
Actions = <>
Expand Down
2 changes: 0 additions & 2 deletions samples/custom_auth/MyWebModuleU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ procedure TMyWebModule.WebModuleCreate(Sender: TObject);
FMVC := TMVCEngine.Create(Self,
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';
// default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
// default content charset
Expand Down
2 changes: 0 additions & 2 deletions samples/custom_exception_handling/WebModuleU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ procedure TMyWebModule.WebModuleCreate(Sender: TObject);
FMVC := TMVCEngine.Create(Self,
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';
// default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
// default content charset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ procedure TMyWebModule.WebModuleCreate(Sender: TObject);
FMVC := TMVCEngine.Create(Self,
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';
// default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
// default content charset
Expand Down
2 changes: 0 additions & 2 deletions samples/custom_logger/WebModuleU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ procedure TMyWebModule.WebModuleCreate(Sender: TObject);
FMVC := TMVCEngine.Create(Self,
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';
// default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
// default content charset
Expand Down
2 changes: 0 additions & 2 deletions samples/custom_role_auth/MyWebModuleU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ procedure TMyWebModule.WebModuleCreate(Sender: TObject);
FMVC := TMVCEngine.Create(Self,
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';
// default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
// default content charset
Expand Down
7 changes: 3 additions & 4 deletions samples/htmx/Controllers/uBase.Controller.pas
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TBaseController = class(TMVCController)
public
[MVCPath(''), MVCHTTPMethod([httpGET])]
[MVCProduces('text/html')]
procedure Index;
function Index: String;

end;

Expand Down Expand Up @@ -58,10 +58,9 @@ function TBaseController.GetGenreService: TGenreService;
Result := FGenreService;
end;

procedure TBaseController.Index;
function TBaseController.Index: String;
begin
LoadView(['header', 'index', 'footer']);
RenderResponseStream;
Result := RenderViews(['header', 'index', 'footer']);
end;

procedure TBaseController.OnAfterAction(AContext: TWebContext; const AActionName: string);
Expand Down
2 changes: 1 addition & 1 deletion samples/htmx/Controllers/uMovie.Controller.pas
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ procedure TMovieController.RenderForm(const AViewNames: TArray<string>);
begin
PageData.b['InsertMode'] := FInsertMode;
PageData.b['IncludeBlankRow'] := FIncludeBlankRow;
LoadView(AViewNames);
ResponseStream.Append(RenderViews(AViewNames));
RenderResponseStream;
end;

Expand Down
2 changes: 1 addition & 1 deletion samples/htmx/uConfig.Module.pas
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ procedure TConfigModule.WebModuleCreate(Sender: TObject);
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';

// default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
// default content charset
Expand Down
19 changes: 11 additions & 8 deletions samples/htmx_mustache/WebSiteControllerU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function TWebSiteController.EditPerson(guid: string): String;
lItem.Selected := lPerson.Items.Contains(lItem.DeviceName);
end;
ViewData['deviceslist'] := lDevices;
Result := Page(['editperson']);
Result := RenderViews(['header','editperson','footer']);
finally
lDevices.Free;
end;
Expand Down Expand Up @@ -158,7 +158,7 @@ function TWebSiteController.MustacheTemplateShowCase: String;
ViewData['people'] := lPeople;
ViewData['people2'] := lPeople2;
ViewData['myobj'] := lMyObj;
Result := PageFragment(['showcase']); //it is not a "fragment" but we don't need standard headers/footer
Result := RenderView('showcase'); //it is not a "fragment" but we don't need standard headers/footer
finally
lMyObj.Free;
end;
Expand All @@ -179,7 +179,7 @@ function TWebSiteController.NewPerson: String;
lDevices := LDAL.GetDevicesList;
try
ViewData['deviceslist'] := lDevices;
Result := Page(['editperson']);
Result := RenderView('editperson');
finally
lDevices.Free;
end;
Expand All @@ -202,7 +202,7 @@ function TWebSiteController.PeopleList: String;
lPeople := LDAL.GetPeople;
try
ViewData['people'] := lPeople;
Result := Page(['people_list_search', 'people_list', 'people_list_bottom']);
Result := RenderViews(['people_list_search', 'people_list', 'people_list_bottom']);
finally
lPeople.Free;
end;
Expand All @@ -221,7 +221,7 @@ function TWebSiteController.PeopleSearch(const SearchText: String): String;
ViewData['people'] := lPeople;
if Context.Request.IsHTMX then
begin
Result := PageFragment(['people_list']);
Result := RenderView('people_list');
if SearchText.IsEmpty then
Context.Response.HXSetPushUrl('/people/search')
else
Expand All @@ -232,7 +232,8 @@ function TWebSiteController.PeopleSearch(const SearchText: String): String;
var lJSON := TJSONObject.Create;
try
lJSON.S['q'] := SearchText;
Result := Page(['people_list_search', 'people_list', 'people_list_bottom'], lJSON);
ViewData['json'] := lJSON;
Result := RenderViews(['people_list_search', 'people_list', 'people_list_bottom']);
finally
lJSON.Free;
end;
Expand Down Expand Up @@ -265,7 +266,8 @@ function TWebSiteController.ShowModal: String;
begin
var lJSON := StrToJSONObject('{"message":"Do you really want to delete row?", "title":"Bootstrap Modal Dialog"}');
try
Result := PageFragment(['modal'], lJSON);
ViewData['json'] := lJSON;
Result := RenderView('modal');
finally
lJSON.Free;
end;
Expand All @@ -278,7 +280,8 @@ function TWebSiteController.ShowModalForDelete(guid: string): String;
lJSON.S['title'] := 'Bootstrap Modal Dialog';
lJSON.S['message'] := 'Do you really want to delete row?';
lJSON.S['guid'] := guid;
Result := PageFragment(['modal'], lJSON);
ViewData['json'] := lJSON;
Result := RenderView('modal');
finally
lJSON.Free;
end;
Expand Down
2 changes: 1 addition & 1 deletion samples/htmx_mustache/htmx_mustache.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var
begin
ReportMemoryLeaksOnShutdown := True;
LogI('HTMX DMVCFramework Sample');
LogI(Format('Starting HTTP Server on port %d', [APort]));
LogI(Format('Listening on http://localhost:%d', [APort]));
ResetConsole;
LServer := TIdHTTPWebBrokerBridge.Create(nil);
try
Expand Down
Loading

0 comments on commit 127bb7f

Please sign in to comment.