I need some help finding a tutorial or such to help me make a basic one.
im looking for some full ones, hopefully basic ones though, since I'm somewhat new. The simpler the better, I just wanna learn the basics then try my hand at it.
thx in advance
I figured out that a lot of ppl dont like template systems. They say it is not really good to have to learn a whole new language.
but then i see a lot of ppl who like them too.
I think i still wanna try it, but I still cannot find a good tutorial for a basic template system. I have searched the web and many forums, and no tutorials seem to be worth reading (to me, since they are not what I want - they either try and work around using template engines, or try and use existing template engines). I want to find a way to make my own system, but maybe veer away from having to write my own language.
I dont know if that is possible though
I need help on making a template system
Moderator: General Moderators
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
engine = word that actually means set of functions that do the stuff to display your template
no need to learn a new language, you only need php. unless by new language, you meant php.. heh
basic one:
url example: site.com/index.php?id=news
index.php:
header.txt:
footer.txt:
home.txt:
news.txt:
contact.txt:
Yup. Pretty basic..
no need to learn a new language, you only need php. unless by new language, you meant php.. heh
basic one:
url example: site.com/index.php?id=news
index.php:
Code: Select all
<?php
if(empty($_GET['id'])){ $id = "home"; }
else { $id = $_GET['id']; }
include("header.txt");
include($id . "txt");
include("footer.txt");
?>Code: Select all
<html>
<head>
<title>my site!</title>
<link rel="stylesheet" type="text/css" href="linktostyle.css" />
</head>
<body>
<div id="header"><img src="banner.jpg"></div>
<div id="menu"><a href="index.php">Home</a> - <a href="index.php?id=news">News</a> - <a href="index.php?id=contact">Contact</a></div>
<div id="content">Code: Select all
<div id="footer">Copyright badkdni 2004-2006. Hosted by fnfg</div>
</body>
</html>Code: Select all
Welcome to my site! blah blah blah!<br /><br />
I have lots of pages on my site and a pretty new templating system! yay!Code: Select all
4/2/04: updated stuff! <br />
5/6/04: morrrrre stuffff<br />
5/7/04: yup.<br />Code: Select all
email: fuhgvf@hufdgbjf.com
aim: blargity!
msn: word@yo.homie_O_o