Comments (14)
Original fcl-web which brook is based on has fptemplate (moved to fcl-base since it's proven to be usable outside of web environment)
silvio has jtemplate
I have qtemplate and view (not yet uploaded, I'll do later)
Each has different features
from brookframework.
The JTemplate link is: https://github.com/silvioprog/jtemplate
What the link of QTemplate?
from brookframework.
What the link of QTemplate?
I haven't uploaded it, because I develop in office (which I haven't sent to my home computer yet, and my office internet is very limited). I'm going to send it home today.
However, I also have view: https://dl.dropboxusercontent.com/u/22124591/view.tar.gz
Both are built on top of FPTemplate, with different concept. View is more passive, for instance with the following template:
$(News
[Content=
<div class="news">
<div class="post-title">~PostTitle</div>
<div class="posted-by">Posted by ~Poster</div>
<div class="date">on ~Date</div>
<div class="post-content">~PostContent</div>
</div>
]
[Separator=<hr />]
)
Example code to use them:
procedure THomeAction.Get;
var
HomeView: TView;
TempVar: TViewVariable;
begin
StyleSheets.Add('news.css');
HomeView := TView.Create('templates/home.html');
TempVar := HomeView['News'];
TempVar.Value := StringsReplace(
TempVar['Content'],
['~PostTitle','~Poster','~Date','~PostContent'],
['Test Title 1','Admin',DateTimeToStr(Now),'<p>Test Post 1</p>'],
[rfReplaceAll]
);
TempVar.Value := TempVar.Value + TempVar['Separator'];
TempVar.Value := TempVar.Value + StringsReplace(
TempVar['Content'],
['~PostTitle','~Poster','~Date','~PostContent'],
['Test Title 2','Admin',DateTimeToStr(Now),'<p>Test Post 2</p>'],
[rfReplaceAll]
);
Content := HomeView.GetContent;
HomeView.Free;
end;
QTemplate on the other hand still preserve the event driven approach, only now for each tag, user must create a callback instead of centralized in a single method. The class is the one responsible for tag checking and calling the appropriate callback.
ATM, QTemplate is faster because it traverse the template only once, while View does it twice (first to get the tags, second to replace them).
from brookframework.
Here's QTemplate: https://dl.dropboxusercontent.com/u/22124591/qtemplate.zip
from brookframework.
Are you versioning the QTemplate? It can be a Book plugin.
from brookframework.
I'm uploading to bitbucket
from brookframework.
I've improved the test program quite a lot to show the usefulness. I don't know whether it's a good idea to make it part of Brook (jtemplate is not part of Brook as well, isn't it?). Besides, I like Mercurial much better than Git due to sane and more powerful and easier to use GUI frontend (TortoiseHg).
from brookframework.
To do its very simple, add "Brook plugin" on README of your project and make a small demo showing how to use the plugin with Brook.
I use Github because it is more accessed than Bitbuket, and the interface is very clean and intuitive. My Git GUI is SmartGIT, it is free (for non comercial use) and have several features to manage GIT. It runs on Linux/Windows too, with the same interface. :)
from brookframework.
... soon, I will create the page "http://brookframework.org/plugins" and upload all Brook plugins for it. :)
from brookframework.
I'll see whether it's possible to use both git and mercurial for the same repo directory. both seems to use one hidden folder on project top dir only (.git / .hg) so in theory there should be no problem
Sent from my Android phone with mail.com Mail. Please excuse my brevity.
from brookframework.
Cloned in github, added sample usage with brook (taken from brook static file broker demo): https://github.com/leledumbo/QTemplate
from brookframework.
Thank you very much! Soon I'll upload all Brook plugins to: http://brookframework.org/plugins
from brookframework.
Can I close this issue buddy?
from brookframework.
Closed for lack feedback.
from brookframework.
Related Issues (20)
- Why plugins projects on github to brookframework is closing? HOT 4
- Telegram plugin for brookframework HOT 15
- i18n HOT 4
- Version 4 ? HOT 14
- libbrook.pas in Source HOT 3
- tardigrade demos throwing errors in libbrook HOT 4
- Server requirements? HOT 4
- dopf & LastInsertID HOT 4
- httprouter.lpr throwing error HOT 2
- How am I supposed to free worker thread in brook daemon? HOT 9
- Use legacy application with tardigrade HOT 19
- CPU Activity is high for tardigrade projects BROOK4 HOT 4
- More documentation HOT 1
- Can't get POST request data HOT 13
- Brookframework with sagui (legacy) HOT 11
- HTTP Client HOT 1
- Where did the captcha plugin for 4.0 go? HOT 1
- Some suggestion about JTemplate? HOT 3
- [IDEA] New repository HOT 1
- EBrookHTTPServer: Failed to send data in request for HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brookframework.