osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

New Template design idea

This is a discussion on New Template design idea within the osCMax v1.7 Discussion forums, part of the osCMax v1.7 Forums category; Hi, I was wondering if it would not be easier for us to create a template class to handle templates: ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v1.7 Forums > osCMax v1.7 Discussion

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 12-04-2003, 07:35 AM
Lurker
 
Join Date: Dec 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
xwisdom
Default New Template design idea

Hi,

I was wondering if it would not be easier for us to create a template class to handle templates:

$tp = new Template('templatefile.tpl.html')

// adding strings
$tp->addContent('content_name','Some content')

// adding other templates
$tp->addContent('other_content',new Template('other_file.tpl.html'))

// now we can add anything to the template
$tp->addContent('whatever_name','whatever_text')

// the final step is to generate and/or display the template

$html = $tp->generate() // returns the contents of the template

or

$tp->display() // sends the content directly to the client

The template would use only html codes and placeholders and not php codes.

e.g.

<html>
<body>
{@content_name}
{@conten_name2}
</body>
</html>

{@content_name} is a placeholder for the missing content.

This would completely separate the php (or Business) logic from the html user interface (UI) design. In my view I think is is much cleaner and easier to maintain. The templates are to be pure html files and can be easily modified with any html editor.

--
Xwisdom
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
OscMax to replace OsCommerce? A good idea? Kristina osCMax v1.7 Installation 4 04-20-2005 08:19 PM
Problems with the design jcrespi osCommerce 2.2 Modification Help 0 07-25-2004 05:59 PM
Home breadcrum link won't work, any idea? vandiike osCMax v1.7 Discussion 5 02-26-2004 01:36 PM
Graphic design templates Anonymous osCMax v1.7 Discussion 0 10-15-2003 08:18 PM


All times are GMT -8. The time now is 11:47 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax