Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Simple Template System
Miles
post Apr 22 2008, 06:30 PM
Post #1


Advanced Member
Group Icon

Group: [HOSTED]
Posts: 177
Joined: 25-December 07
Member No.: 27,129



Hello,
This is my first tutorial at astahost. It covers how to make a simple template system, which I use in some of my software.
To start, we need a page that will be the template itself. For this tutorial, below is a very simple one:
CODE
<HTML>
<HEAD>
<TITLE> PHP Template System </TITLE>
</HEAD>
<BODY>
<H1> <?php echo $content; ?> </H1>
</BODY>
</HTML>

Save this as template.html

Next, the php, also very simple:
CODE
<?php
$content = "Test";
include "template.html";
?>

You'll notice the variables $content contains the content of the page you wish to appear. This coding is simple and can easily be expanded on, for instance, you could use GET to have multiple pages, or have sidebars and add extra variables for them. It's simple coding, but it's not bad either.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. basic html template(1)
  2. JavaScript template(1)
  3. ASP.NET VB template(0)
  4. Get Afree Template For Your Site(3)
  5. My New Template I Made(26)
  6. How Difficult Is It To Edit A Bought Template ?(12)
  7. Little Help On Which Template Plz(3)
  8. Website Template Design Tutorial(0)
  9. Your Opinion On An Edited Joomla! Template(17)
  10. Youth-oriented Template(10)
  11. Template Review(12)
  12. Shop Template(4)
  13. Need Help With A Joomla Template(4)
  14. I Need A Template For A Website(9)


 



- Lo-Fi Version Time is now: 7th October 2008 - 05:15 AM