Re: PHP 4.0.5 Release & Midgard Problems

From: Date: Sun, 01 Apr 2001 08:10:53 +0000
Subject: Re: PHP 4.0.5 Release & Midgard Problems
References: 1 2 3 4  Groups: php.dev 
Request: Send a blank email to php-dev+get-50468@lists.php.net to get a copy of this message
On Sun, Apr 01, 2001 at 09:07:44AM +0200, Sebastian Bergmann wrote: > Alexander Bokovoy wrote: > > Ask Zend folks, they have our proposals, even C code to Zend engine > > to implement native templating with no connection to Midgard at all - > > this system was designed to be generic for any template providers. > > Does this have to be implemented in the ZendEngine or would a > ext/template extension (for instance) be possible, also? This would be > great, though Template Engines are a dying species with the advent of > XSLT, IMHO. Not so simple because XSLT is far than complex for lot of applications and especially when you are trying to provide content edit capabilities for non-techies. This is huge nische. It most effective at ZendEngine level but actually task is two-tiered. Let me describe: 1. Templating require additional syntax which is better handled by ZendEngine 2. Syntax provides access to collection of template elements and manipulation of them. It's up to template provider to collect template elements from some source(s) before actual template building. This is better handled by extensions. This separation also allows to make complex transitions like 'document with template markup' -> XML-based source + XSLT -> output In this case second step is done by Template Provider which provides template elements + hooks to translate them to XML + output callbacks. Zend Engine dispatches these calls via easy user-oriented syntax. For example, in Midgard we have two kinds of template calls: <[template element]> -- just insert content of template element here and evaluate it as PHP code. It looks like hidden functional call to include() but the difference is that 'template element' actually can come from completely different place than file system (in Midgard it comes from Database or FileTemplates). &(variable:formatter); -- pass $variable throught existing formatter and insert output into output stream. Different formatters allow to convert plain text to HTML with different levels of formatting, execute PHP code, execute user-defined formatter against $variable. Variable could be any PHP structure (scalar, object, array, etc) These are very simple constucts, but they are greatly reduce build-up for non-technical interfaces. -- Sincerely yours, Alexander Bokovoy The Midgard Project | ALT Linux Team | Minsk Linux Users Group www.midgard-project.org | www.altlinux.ru | www.minsk-lug.net -- Success is in the minds of Fools. -- William Wrenshaw, 1578

« previous php.dev (#50468) next »