Renamed templatepro filter "query" to "fromquery"
Some checks failed
TOC Generator / TOC Generator (push) Has been cancelled

This commit is contained in:
Daniele Teti 2024-10-07 16:53:02 +02:00
parent f9d5850914
commit bc065284f8
2 changed files with 8 additions and 2 deletions

View File

@ -79,7 +79,7 @@ begin
end end
else else
begin begin
if TDuckTypedList.CanBeWrappedAsList(aValue.AsObject, lWrappedList) then if (aValue.AsObject <> nil) and TDuckTypedList.CanBeWrappedAsList(aValue.AsObject, lWrappedList) then
begin begin
Result := lWrappedList.Count; Result := lWrappedList.Count;
end end
@ -176,7 +176,7 @@ begin
end; end;
lCompiledTemplate.AddFilter('json', DumpAsJSONString); lCompiledTemplate.AddFilter('json', DumpAsJSONString);
lCompiledTemplate.AddFilter('count', GetDataSetOrObjectListCount); lCompiledTemplate.AddFilter('count', GetDataSetOrObjectListCount);
lCompiledTemplate.AddFilter('query', lCompiledTemplate.AddFilter('fromquery',
function (const aValue: TValue; const aParameters: TArray<string>): TValue function (const aValue: TValue; const aParameters: TArray<string>): TValue
begin begin
if Length(aParameters) = 1 then if Length(aParameters) = 1 then

View File

@ -923,6 +923,7 @@ type
/// PageFragment ignore header and footer views /// PageFragment ignore header and footer views
/// </summary> /// </summary>
function Page(const AViewNames: TArray<string>; const UseCommonHeadersAndFooters: Boolean = True): string; overload; inline; function Page(const AViewNames: TArray<string>; const UseCommonHeadersAndFooters: Boolean = True): string; overload; inline;
function Page(const AViewName: string; const UseCommonHeadersAndFooters: Boolean = True): string; overload; inline;
/// <summary> /// <summary>
/// Page calls GetRenderedView with sensible defaults. /// Page calls GetRenderedView with sensible defaults.
@ -4392,6 +4393,11 @@ begin
Result := GetRenderedView(AViewNames, JSONModel) Result := GetRenderedView(AViewNames, JSONModel)
end; end;
function TMVCController.Page(const AViewName: string; const UseCommonHeadersAndFooters: Boolean): string;
begin
Result := Page([AViewName], UseCommonHeadersAndFooters);
end;
function TMVCController.PageFragment(const AViewNames: TArray<string>; function TMVCController.PageFragment(const AViewNames: TArray<string>;
const JSONModel: TJSONObject): string; const JSONModel: TJSONObject): string;
begin begin