You are here: Re: [PHP] Adding Loop / If support to a simple template engine « PHP « IT news, forums, messages
Re: [PHP] Adding Loop / If support to a simple template engine

Posted by Drewcore on 04/07/05 06:04

a parser is a program that i will take some preformatted text, extract
the information from it, and then do work with that information. xml
programs users parses to pull data from between the <> tags.

in your case, you'd have to have some sort of declaration in your code
that sets apart code blocks you want replaced, invent some sort of
system of replacing that code on demand, then write that code that
implements your system. a little difficult, and out of my scope, i'm
sure. unless i spent two weeks with minimal sleep.

drew

On Apr 6, 2005 9:37 PM, James Williams <php@jamwil.com> wrote:
> Richard Lynch wrote:
> > On Wed, April 6, 2005 7:04 pm, James Williams said:
> >
> >>Hey fellas, I'm makin a forum right now and as a sub project, I'm making
> >>a template engine / class. Right now all it does is variable
> >>replacement, however I am curious as to how I can implement support for
> >>loops and if statements. I would appreciate any ideas that you may
> >>have, thank-you!
> >
> >
> > You'll have to write a parser.
> >
> > Or use something like bison/flex/yacc to create one for you.
> >
> > This is not something you want to try to knock out in an afternoon because
> > you're bored. :-)
> >
> Thank-you, but what exactly does a parser do?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация