Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Moderated Pro PHP
|
Moderated Pro PHP This is a moderated forum for discussing advanced, professional level issues with PHP. Your posts will not appear until a moderator approves them. Posts that are not the right level for this forum will be responded to and you'll be asked to post them in the [url="http://p2p.wrox.com/sql-server-2000-20/9"]Beginning PHP[/url] forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Moderated Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 29th, 2006, 07:38 AM
Registered User
 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default creating a templating parser with PHP

Does anybody have experience with creating an own parser in PHP?
I have to create a CMS with a specific templating code.
It is not just find and replace... it's more.
I'll give an example to make it clear.

I have a contenttype "news". There is a page that must show the last 10 newsitems. In the template we can find something like this:

<html>
<body>
<h1>Welcome to the newspage</h1>
<news items="10" order="datedesc" />
</body>
</html>

That's it for the page.
In the configuration of the contenttype news we can configure how an item must appear, a template...
It looks something like this:

<h3>##TITLE##</h3>
<p>##BODY##</p>

As you can see, the title and body field are fields specific for the newsitem. For 1 item i can do a replace on ##TITLE## and ##BODY## but wouldn't that be to intense if i have a lot of fields?

I need some sort of a pattern to create a robust mechanism to create such a templating system.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a login page in PHP bhavna General .NET 0 February 16th, 2007 07:32 AM
Creating a php order form Beckie Beginning PHP 10 February 15th, 2007 12:20 PM
creating thumbnail for pdf files via php pritz PHP How-To 0 March 10th, 2006 04:09 AM
Help needed: the PHP parser don't work! pbuongiovanni PHP How-To 8 January 12th, 2006 07:32 AM
php parser fakhrul Pro PHP 9 August 10th, 2004 11:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.