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: ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| 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 |
| Thread Tools | |
| |
| ||||
| 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 |