From: Arno H. <aho...@in...> - 2000-12-07 16:49:36
|
On Thursday 07 December 2000 15:14, Jan Hidders wrote: > So why not simply use PHP [for templates] to do this > in stead of trying to write your own script interpreter? Because > - the templates become less readable if you don't know any PHP and: - you move back code into the templates - the exact opposite of what templates are for, no? - you can't use "echo" inside templates. You want the whole page returned as string, so that you can mangle it further, or do e.g. an HTML dump of the entire wiki. > + phpwiki code gets simpeler Not necessarily. Only some functionality of GeneratePage is moved to the template. Not much saving in complexity here. All you do is saving a few str_replace. Worth the hassle? > + future extensions for templates will be far more easy to program (just > define some new PHP variables and functions) This is exactly the same amount of work needed in its current form. Plus one str_replace per extension. Actually, I was very upset that I had to introduce ###IF### into the templates. But it looked like the only reasonable choice. Note that I didn't even bother to include an ###ELSE### directive. I have given the idea of using PHP inside templates some thought, before I implemented the current template form. For me it boils down to simplicity - meaning simplicity for the user and not for us programmers. And I think from the standpoint of simplicity the current form wins hands down against using PHP. (one may argue about ###IF###, I agree) Of course, if we ever needed more complex directives such as for, while, variables ... I would rethink my position again and go for PHP I think. But currently I don't see a need for it. We don't even have per-user customization or user accounts at all for that matter. Unless we introduce user accounts (and a right-managament system) I don't think there is need for a more sophisticated templating language. You may start to wonder if I am opposed to every and all idea you propose. But please understand that I'm just arguing my point of view. I may be wrong, and I don't have the final word. Try to convince me, come up with a killer example. You know, in your first email you wrote: > I have used phpwiki a little now and really like it, > especially its simplicity and accessability. That's what I'm trying to protect here. /Arno |