Click to See Complete Forum and Search --> : outline: a different kind of template engine for php
mindplay
03-16-2008, 05:37 PM
Hello,
I would like to announce my template engine, Outline, which is now available:
http://outline.mindplay.dk
This is quite different from most template engines you might have seen. Instead of inventing a whole new syntax, it borrows from php, but also adds useful shortcuts, such as the modifier syntax, which is borrowed from Smarty.
It supports all the usual stuff like commands, blocks, modifiers, compiled templates, multi-level caching and so on. It does all of this in under 1000 lines of code.
It is still in development, and probably not quite ready for production usage yet, but please go ahead and try it out, post your comments, ideas, etc. - there's a forum on the site, which you're welcome to use.
thanks!
dougal85
03-29-2008, 05:10 PM
For people that are lazy like me, where can I see example usage?
PHP has so many template engines...
mindplay
03-29-2008, 06:47 PM
For people that are lazy like me, where can I see example usage?
PHP has so many template engines...
There is no running demo online at the moment.
But you can examine the template syntax here (http://code.google.com/p/php-outline/wiki/Syntax), and the how to use the template class here (http://code.google.com/p/php-outline/wiki/Usage).
In the latest version, there is also a wrapper-class with similar syntax to Smarty, called OutlineTpl, which has the assign(), assign_by_ref(), render() and fetch() methods, and functions basically in the same way, e.g. more like traditional template engines.
halojoy
03-29-2008, 08:32 PM
Hello,
I would like to announce my template engine, Outline, which is now available:
http://outline.mindplay.dk
This is quite different from most template engines you might have seen. Instead of inventing a whole new syntax, it borrows from php, but also adds useful shortcuts, such as the modifier syntax, which is borrowed from Smarty.
I have already visit your Project (google code).
This was when I did my latest survey and research of PHP Template Engines.
But I cant give any rview or verdict
as you, as far as I know, havent had the courage to publish any code.
I did look for ZIP file in the spirit of OPEN Source, ... but to no luck.
I have though, the scripts of many other similar Template Engines.
Such that I can download and examine and tryout, if I find it interesting.
Among ideas in Templating using PHP, I agree with the opinions of Author of an old template Engine:
bTemplate
http://massassi.com/bTemplate/
In short, if you use a template engine advanced and all such syntax machinery
you CREATE Overhead load onto your scripts .... slownig down.
PHP functions in themselves are excellent in taking strings and display them.
This is what PHP language is a tool for from the first beginning:
Pre Hyper text Processor.
I think you should have a read of the an updated Conclusion of bTemplate author.
He has revised some ideas and his opinion is most sound and good,
if you ask me.Template Engines
Note: This article has been updated. The old version is available here.
License Note: Please consider the code in this article public domain.
In general, template engines are a "good thing." I say that as a long time PHP/perl programmer, user of many template engines (fastTemplate, Smarty, perl's HTML::Template), and author of my own, bTemplate.
However, after some long discussions with a co-worker,
I've decided that the vast majority of template engines (including my own) simply have it wrong.
I think the one exception to this rule would be Smarty,
although I think it's simply too big,
and considering the rest of this article, pretty pointless.
----------------------------
This document © Copyright 2003 Brian Lozier
My own latest website project, uses my Own very basic Template class.
Has got only 3 methods:
1. __construct()
2. assign( array)
3. parse ('tpl file name')
use-age:<?php
$tpl = new template;
$tpl->assign(array('token', 'replace values' ....))
$output = $tpl->parse( 'template-file.tpl')
echo $output; // display HTML
?>
Web source Brian Article:
http://massassi.com/php/articles/template_engines/
regars
halojoy
mindplay
03-30-2008, 07:45 AM
as you, as far as I know, havent had the courage to publish any code.
I did look for ZIP file in the spirit of OPEN Source, ... but to no luck.
There's no zip file. As in "the spirit of open source", the code is being made available via Subversion, with several updates every week, sometimes several daily updates. When the codebase is stable, there will be a release, and a zip file.
As for your performance concerns, Outline is really [http://template-bench.iliakantor.ru/]not much slower[/url] than straight php templates (without any engine).
Why don't you come back with your criticisms when you've actually seen it ;-)
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.