FWD: [[ANN] Kwartz-php 0.3.0 - a template system for PHP, Ruby, and Java]

This is a discussion on FWD: [[ANN] Kwartz-php 0.3.0 - a template system for PHP, Ruby, and Java] within the PHP Language forums, part of the PHP Programming Forums category; --- forwarding --- From: Makoto Kuwata <kwa@kuwata-lab.com> Date: Sat, 01 Jan 2005 22:39:50 +0900 Subject: [...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-08-2005
Makoto Kuwata
 
Posts: n/a
Default FWD: [[ANN] Kwartz-php 0.3.0 - a template system for PHP, Ruby, and Java]

--- forwarding ---
From: Makoto Kuwata <kwa@kuwata-lab.com>
Date: Sat, 01 Jan 2005 22:39:50 +0900
Subject: [php] [ANN] Kwartz-php 0.3.0 - a template system for PHP, Ruby, and Java

Hi all, A HAPPY NEW YEAR!

I'm pleased to announce the release of Kwartz-php 0.3.0.
http://www.kuwata-lab.com/kwartz-php

Kwartz-php is a template system which is available with multi
programming language (PHP, Ruby and Java).
And it is the first template system that realized the concept of
'Separation of Presentation Logic and Presentaion data' (SoPL/PD).

It is available to separate the presentation layer from the
main program with any template system. In addition, Kwartz-php
enables you to separate the presentation logics (iteration and
conditional branching) from the presentation data (HTML file).


Features:
* Separates presentation logic from presentation data.
* Runs very fast
* Supports multiple programing languages (PHP/Ruby/Java)
* Doesn't break HTML design at all
* Handles any text file
* Supports Auto-Sanitizing and Partial-Sanitizing


Example:

* Presentation Data (example.html)
- There is no iteration nor conditional branching
in the presentation data file.
--------------------
<table>
<tr id="mark:values">
<td>@{$var}@</td>
</tr>
</table>
--------------------

* Presentation Logic (example.plogic)
- There is no HTML tags in the presentation logic file.
--------------------
## Re-define an element
element values { ## element
foreach ($list as $var) {
@stag; ## start tag
@cont; ## content
@etag; ## end tag
}
}
--------------------

* Compile
- Generate an output script from presentation data
and presentation logic.
--------------------
$ kwartz-php -p example.plogic example.html > example.php

$ kwartz-php -l eruby -p example.plogic example.html > example.rhtml

$ kwartz-php -l jstl11 -p example.plogic example.html > example.jsp
--------------------

* Output Script
(PHP)
--------------------
<table>
<?php foreach ($list as $var) { ?>
<tr>
<td><?php echo $var; ?></td>
</tr>
<?php } ?>
</table>
--------------------

(eRuby)
--------------------
<table>
<% for var in list do %>
<tr>
<td><%= var %></td>
</tr>
<% end %>
</table>
--------------------

(JSTL)
--------------------
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<table>
<c:forEach var="var" items="${list}">
<tr>
<td><c:out value="${var}" escapeXml="false"/></td>
</tr>
</c:forEach>
</table>
--------------------

The above examples shows:
* Presentation data (= HTML file) doesn't contain any logics.
* Presentation logic file doesn't contain any data.
* These are separated from the main program.

The command-line option '-e' escapes the HTML special chars
with 'htmlspecialchars()' in PHP, 'CGI::escapeHTML()' in eRuby,
and '<c:out/>' tag without 'escapeXml="false"' in JSTL.


Web Page:
http://www.kuwata-lab.com/kwartz-php

Download:
https://www.kuwata-lab.com/kwartz-php/download.html

Users Guide:
http://www.kuwata-lab.com/kwartz-php/users-guide.en.html

Reference Manual:
http://www.kuwata-lab.com/kwartz-php/reference.en.html

Changes from 0.2.0:
* [enhance] support new functions (list_length(), str_toupper(), etc)
* [enhance] support JSTL 1.1
* [change] indent format of output script is changed
* [bugfix] some bugs are fixed
see http://www.kuwata-lab.com/kwartz-php/ChangeLog.html for details.


I hope you'd like it.

--
regards,
kwatch

# [off topic]
# I have submitted Kwartz-php to the Zend PHP5 contest, but ignored.
# I have also submitted the Code/App Gallery, but ignored again. Sol...
Reply With Quote
  #2 (permalink)  
Old 01-08-2005
Chung Leong
 
Posts: n/a
Default Re: [[ANN] Kwartz-php 0.3.0 - a template system for PHP, Ruby, and Java]

"Makoto Kuwata" <kwa@kuwata-lab.com> wrote in message
news:1ccce21f.0501080512.52f46507@posting.google.c om...
> --- forwarding ---
> From: Makoto Kuwata <kwa@kuwata-lab.com>
> Date: Sat, 01 Jan 2005 22:39:50 +0900
> Subject: [php] [ANN] Kwartz-php 0.3.0 - a template system for PHP, Ruby,

and Java
>
> Hi all, A HAPPY NEW YEAR!
>
> I'm pleased to announce the release of Kwartz-php 0.3.0.
> http://www.kuwata-lab.com/kwartz-php
>
> Kwartz-php is a template system which is available with multi
> programming language (PHP, Ruby and Java).
> And it is the first template system that realized the concept of
> 'Separation of Presentation Logic and Presentaion data' (SoPL/PD).


Funny how things go sometimes. Technologies like ASP, JSP, and PHP were born
out of desire to have logic within the presentation. Now you have people
coming along wanting to rip it out.

Might as well go back to making HTML pages with Perl.


Reply With Quote
  #3 (permalink)  
Old 01-09-2005
Tony Marston
 
Posts: n/a
Default Re: [[ANN] Kwartz-php 0.3.0 - a template system for PHP, Ruby, and Java]


"Makoto Kuwata" <kwa@kuwata-lab.com> wrote in message
news:1ccce21f.0501080512.52f46507@posting.google.c om...
> --- forwarding ---
> From: Makoto Kuwata <kwa@kuwata-lab.com>
> Date: Sat, 01 Jan 2005 22:39:50 +0900
> Subject: [php] [ANN] Kwartz-php 0.3.0 - a template system for PHP, Ruby,
> and Java
>
> Hi all, A HAPPY NEW YEAR!
>
> I'm pleased to announce the release of Kwartz-php 0.3.0.
> http://www.kuwata-lab.com/kwartz-php
>
> Kwartz-php is a template system which is available with multi
> programming language (PHP, Ruby and Java).
> And it is the first template system that realized the concept of
> 'Separation of Presentation Logic and Presentaion data' (SoPL/PD).


No, it is not the first. My web application produces XML files which are
transformed into XHTML usinf XSL stylesheets. This provides the following
degrees of separation:
(1) XML files contain data only, no processing instructions.
(2) XSL stylesheets contain processing instructions, no data.

It is also possible to use alternative XSL stylesheets to take the same XML
data and transform it into a different type of output, such as PDF, or CSV.

This system is also language independent as it does not care how the XML
file is created - it is, after all, just a plain text file. Thus this
process can be used by any language that can write text files and execute an
XSL transformation.

I suggest that you do not make false claims about a product. It does not
give a good impression.

--
Tony Marston

http://www.tonymarston.net


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:45 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0