mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 07:45:54 +01:00
Fixed linux support for include and layout block in TemplatePro engine
Some checks are pending
TOC Generator / TOC Generator (push) Waiting to run
Some checks are pending
TOC Generator / TOC Generator (push) Waiting to run
This commit is contained in:
parent
acdec2fd44
commit
53d8efd048
@ -5301,28 +5301,29 @@ function TMVCBaseViewEngine.GetRealFileName(const AViewName: string): string;
|
||||
var
|
||||
lFileName: string;
|
||||
lDefaultViewFileExtension: string;
|
||||
lTemplateFolder: string;
|
||||
begin
|
||||
lDefaultViewFileExtension := Config[TMVCConfigKey.DefaultViewFileExtension];
|
||||
lFileName := StringReplace(AViewName, '/', '\', [rfReplaceAll]);
|
||||
lFileName := StringReplace(AViewName, '/', PathDelim, [rfReplaceAll]);
|
||||
|
||||
if (lFileName = '\') then
|
||||
if (lFileName = PathDelim) then
|
||||
begin
|
||||
lFileName := '\index.' + lDefaultViewFileExtension
|
||||
lFileName := PathDelim + 'index.' + lDefaultViewFileExtension
|
||||
end
|
||||
else
|
||||
begin
|
||||
lFileName := lFileName + '.' + lDefaultViewFileExtension;
|
||||
end;
|
||||
|
||||
if DirectoryExists(Config[TMVCConfigKey.ViewPath]) then
|
||||
lTemplateFolder := Config[TMVCConfigKey.ViewPath];
|
||||
if DirectoryExists(lTemplateFolder) then
|
||||
begin
|
||||
lFileName := ExpandFileName(IncludeTrailingPathDelimiter(Config.Value[TMVCConfigKey.ViewPath]) +
|
||||
lFileName)
|
||||
lFileName := ExpandFileName(IncludeTrailingPathDelimiter(lTemplateFolder) + lFileName)
|
||||
end
|
||||
else
|
||||
begin
|
||||
lFileName := ExpandFileName(IncludeTrailingPathDelimiter(GetApplicationFileNamePath +
|
||||
Config.Value[TMVCConfigKey.ViewPath]) + lFileName);
|
||||
lFileName := ExpandFileName(IncludeTrailingPathDelimiter(
|
||||
GetApplicationFileNamePath + lTemplateFolder) + lFileName);
|
||||
end;
|
||||
|
||||
if FileExists(lFileName) then
|
||||
|
@ -600,7 +600,20 @@ begin
|
||||
tkInt64: Result := Value.AsInt64.ToString;
|
||||
tkString, tkUString, tkWString, tkLString: Result := Value.AsString;
|
||||
tkWChar, tkChar: Result := Value.AsType<Char>;
|
||||
tkFloat: Result := FloatToStr(Value.AsExtended, fLocaleFormatSettings);
|
||||
tkFloat: begin
|
||||
if Value.TypeInfo.Name = 'TDate' then
|
||||
begin
|
||||
Result := DateToStr(Value.AsExtended, fLocaleFormatSettings);
|
||||
end
|
||||
else if Value.TypeInfo.Name = 'TDateTime' then
|
||||
begin
|
||||
Result := DateTimeToStr(Value.AsExtended, fLocaleFormatSettings);
|
||||
end
|
||||
else
|
||||
begin
|
||||
Result := FloatToStr(Value.AsExtended, fLocaleFormatSettings);
|
||||
end;
|
||||
end;
|
||||
tkEnumeration: Result := Value.ToString;
|
||||
else
|
||||
raise ETProException.Create('Unsupported type for variable "' + VarName + '"');
|
||||
@ -995,6 +1008,7 @@ begin
|
||||
lFoundVar := False;
|
||||
lFoundFilter := False;
|
||||
Step;
|
||||
lRef2 := -1;
|
||||
if MatchVariable(lVarName) then { variable }
|
||||
begin
|
||||
lFoundVar := True;
|
||||
@ -1002,15 +1016,11 @@ begin
|
||||
Error('Invalid variable name');
|
||||
lFuncName := '';
|
||||
lFuncParamsCount := -1; { -1 means "no filter applied to value" }
|
||||
lRef2 := IfThen(MatchSymbol('$'), 1, -1);
|
||||
// {{value$}} means no escaping
|
||||
lRef2 := IfThen(MatchSymbol('$'), 1, -1); // {{value$}} means no escaping
|
||||
MatchSpace;
|
||||
if MatchSymbol('|') then
|
||||
begin
|
||||
MatchFilter(lVarName, lFuncName, lFuncParamsCount, lFuncParams);
|
||||
end;
|
||||
end
|
||||
else if MatchSymbol('|') then
|
||||
end;
|
||||
|
||||
if MatchSymbol('|') then
|
||||
begin
|
||||
lFoundFilter := True;
|
||||
MatchFilter(lVarName, lFuncName, lFuncParamsCount, lFuncParams);
|
||||
|
Loading…
Reference in New Issue
Block a user