Autor Beitrag
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Fr 19.09.08 16:13 
Hallo zusammen,

ich hatte vor über einem Jahr mal einie interessante Delphi Klasse im Internet gefunden. Leider ist mir der Link abhanden gekommen und über Google und Co finde ich diese Klassen leider auch nicht. Deshalb meine Frage an Euch. ;-)

Ich suche eine Template-Engine Klasse (deren Namen ich leider nicht mehr weiß) in Delphi geschrieben. Diese Klasse war vergleichbar mit der PHP Template Engine Smarty. Im folgenden Mal ein Beispiel wie es ungefähr in Sourcecode aussah:

ausblenden test.pas
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
var
  T : TTemplateEngine;
begin
  T := TTemplateEngine.Create;
  try
    T.LoadFromFile ('test.tpl');
    T.Variables.Add ('Name1', 'Wert1');
    T.Variables.Add ('Name2', 'Wert2');
    T.Parse;
    { ... }
  finally
    T.Free;
  end;
end;


Eine Teamplate Datei sah in etwa wie folgt aus:
ausblenden test.tpl
1:
2:
3:
4:
Erste Zeile
2. Zeile
Dritte Zeile mit der 1. Variable: {$Name1}
4. Zeile mit der 2. Variable: {$Name2}

Die Template Klasse bot auch Funktionen wie IF-THEN oder FOR-NEXT an.

Weiß zufällig jemand von Euch wo ich diese oder eine vergleichbar Template Klasse finde? Danke!!!

Gruß
Tino
Tino Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 22.09.08 13:39 
**push** :mrgreen:
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Di 23.09.08 15:57 
Puhhh... ich hatte mal einen Templater als teil eines Text2HTML-CMS geschrieben. Den wirst du aber kaum meinen, zumal man den definitiv nicht so ansteuert :P

Könnte diese Engine eventuell aus einem Reporting-Paket stammen? Würde sich darin gut machen.

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
Tino Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Fr 26.09.08 14:20 
Hallo!

Nein, das Teil war recht eigenständig und war, so weit ich weiß, nicht Teil eines Reporting-Tools.

Naja, bleibt mir wohl keine andere Wahl als so ein Teil von Grund auf selbst zu programmieren. ;-)

Gruß
Tino
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Fr 26.09.08 18:50 
Für was braucht man denn sowas? Jetzt nur der Neugierde halber...

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Tino Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 29.09.08 11:00 
für eine kleine HTTP Webserver Anwendung. ;-)
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 29.09.08 11:04 

_________________
Markus Kinzler.
Tino Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 29.09.08 11:28 
Hallo!

Dieses Paket habe ich auch bei meiner Vorabsuche gefunden. So wie ich es in Erinnerung habe, verwendet die Template-Engine einen PHP Interpreter und die originalen PHP-Sourcecodedateien von Smarty um die Template-Engine in Delphi zur Verfügung zu stellen.

Einen PHP Interepreter und Smarty-Sourcecode mit auszuliefern ist nicht das was ich mir vorstelle. ;-)

Gruß
Tino