From: Jan H. <hi...@wi...> - 2000-12-07 18:02:09
|
On Thu, Dec 07, 2000 at 05:49:24PM +0100, Arno Hollosi wrote: > > 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 Well, yes, I know, obviously. :-) But do you really think that the example that I gave is really so much harder to read that the original? Remember that the maintainer of a phpwiki-site is going to have to do some configuaration in PHP files anyway. > and: > - you move back code into the templates - the exact opposite of what > templates are for, no? But as you saw yourself, you are now forced to do this anyway. And I am very convinced that there is more to come. > - 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. Ah, but that is the beauty of it all. All you have to do is say at the end of index.php --- include('templates/template.html'); ?> --- and that's it!! You don't even have to start the template with "<?" because the include takes care of that. Of course I am simplifying here because you have to decide which template to include et cetera, but you get the point. > > + 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? Not right now. But as you will add more features this will happen. Regular expressions are going to break down if you get things like nested IF-blocks. Or are you going to introduce a different type of IF-block for every possible combination of flags? > 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. Don't you think that it is safe to say that these things *will* be added in the future? If phpwiki really takes off (and that is what I expect) then these things will be added sooner or later. And at that stage you would have a bigger problem because you would have many site-maintainers that would hate to give up their old templates when upgrading to the latest version. > 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. The nested IF-blocks would probably be one. You need that if you want something inserted only if three flags are true. And you already said yourself that in the near future there will be more flags and the templates will become more complex. > 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. I know, and I respect that. It is not my intention to start a big longdrawn debate here, or anything. (But I cannot really promise that it won't. :-}) You have clearly listened to and thought about my proposal and that is all that I can expect. This is your project and I am just peeping around the corner. I only found one bug and this was mainly due to your excellent coding style. :-) Kind regards, -- Jan Hidders PS. Can I ask you to just send replies to the mailing list? Right now, I am getting two replies every time. Or does Kmail not have that option? |