Re: Fastest templating mechanism

From: Date: Sun, 08 May 2005 09:31:14 +0000
Subject: Re: Fastest templating mechanism
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-214685@lists.php.net to get a copy of this message
You might try using the first pass of a regular C compiler, the pre-compiler, which expands macro definitions. It shouldn't have any problems with the structure of PHP, except for the # comments which it would mistake for its own pre-compiler declarations. Otherwise, may I sugest you check in the archives my own posting with the subject "XML/HTML specific instructions"? Satyam "Evert | Rooftop Solutions" <evert@rooftopsolutions.nl> wrote in message news:427D55F4.20008@rooftopsolutions.nl... > Hi all, > > I'm working on a template system which works a bit like a text translation > block. The data looks for example like: > > beginblock <div class="block"> > endblock </div> > beginauthor <span class="author"> > endauthor </div> > > > The list is going to be very large, it will have several overlays and not > all pages need all items in the list. (usually just a fraction) > > What will be the smartest way to implement this? I need a low-memory cost > and fast solution > I can do it with a php script, like: > > $list = array( > 'beginblock' => '<div class="block">', > > etc. > > ); > > but this will use up too much memory. I could additionally do it with a > textfile, but if I need to loop through it at every lookup it will be > slow.. > > What are your suggestions? > > regards, > Evert

« previous php.general (#214685) next »