473,503 Members | 1,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

templates

hi all,

I m designing my first 'real' site and want to do things proper this time.
Using dreamwaever and php I was wondering what u guys think of templates in
conjunction with php? Do you think it is the best way to apply my site
design to the entire site or are there better ways?

kind regards
Stijn
Jul 17 '05 #1
5 2867

"Stijn Goris" <me*****@hotmail.com> wrote in message
news:3f***********************@news.skynet.be...
hi all,

I m designing my first 'real' site and want to do things proper this time.
Using dreamwaever and php I was wondering what u guys think of templates in conjunction with php? Do you think it is the best way to apply my site
design to the entire site or are there better ways?

kind regards
Stijn


forgot to say that I tried dreamweavers templates but they don't seem be
designed for a coder. Someone knows some good php template classes?

thanks
Jul 17 '05 #2
Stijn Goris wrote:
forgot to say that I tried dreamweavers templates but they don't seem be
designed for a coder. Someone knows some good php template classes?


The best I know is "AwesomeTemplateEngine"
(http://www.pinkgoblin.com/index.php?view=scripts)

Jochen

Jul 17 '05 #3
"Stijn Goris" <me*****@hotmail.com> wrote in message news:<3f***********************@news.skynet.be>...
hi all,

I m designing my first 'real' site and want to do things proper this time.
Using dreamwaever and php I was wondering what u guys think of templates in
conjunction with php? Do you think it is the best way to apply my site
design to the entire site or are there better ways?

kind regards
Stijn

Well for me (and this is for me only, everyone is differnt)

I useualy design a web page first in Dreamweaver, dual window, I code
gui and code inspector at same time. gui to move large stuff around,
and code window to fix dreamweavers idea of what I want.

After page is designed, I open it up in a text editor and pull it
apart,
I tend to make a few files from it

_begin.php - all the code that makes up the main part of the page
_menu.php - any menu area I may have (usealy the _begin file will
include thisone)
_end.php - code that wraps it up

then all my pages, like index.php look like this

<?php
$title = "My page title"
include_once("__begin__.php");
?>

my poage body here or table section
<?php include_once("__end__.php"); ?>
This way any changes I make are automaticaly site wide.
Well, just my 2 bits worth of scripting tape

Mike Bradley
http://gzen.myhq.info -- free online php tools
Jul 17 '05 #4
"Stijn Goris" <me*****@hotmail.com> wrote in message
news:3f***********************@news.skynet.be...
hi all,

I m designing my first 'real' site and want to do things proper this time.
Using dreamwaever and php I was wondering what u guys think of templates in conjunction with php? Do you think it is the best way to apply my site
design to the entire site or are there better ways?


Well, there are at least several opinons on that, but let's say that there
is quite large group of people who find the combination of php and templates
very usefull. If you would like to try them with TemplateTamer and need some
help, just drop me an e-mail.

rush
--
http://www.templatetamer.com/
Jul 17 '05 #5
If you create an object in your php script and call a function on it,
you can have the function include a skin:

<?php
$myPage = new MyPage();
$myPage->handleRequest();
?>

<?php
class MyPage extends AbstractPage {
// you do not raally need the AbstractPage right now,
// but i bet it will prove handy in future,
// so just create it as an empty class

function handleRequest()
{
include('skinMyPage.inc');
}
}
?
The skin really is simply a php script, but it can be much like a
template, whilst having the object do the dirty work. A skin can look
like this:

<!-- skinBody -->
<table><tr>
<td height=100%>
<table>
<tr>
<td class=hoofdmenu>
<?php $this->printMenuPart() ?>
</td>
</tr>
<tr>
<td class=<?php print $this->getInfoStyle() ?>>
Information<BR><BR><BR>
<?php $this->printInformationPart() ?>
</td>
</tr>
</table> <BR>
</td>
<td height=100%>
<?php $this->printMainPart() ?> </td>
</tr></table>
<!-- /skinBody -->

As you see a skin is just a thin layer of layout on top of an object. If
you restrict the skin to only call methods on the object that included
it, you get a very consistent MVC pattern. If the work of the object
becomes too dirty you have the method create some object of its own that
may include another skin. This way you can separate layout from code
without needing a template engine AND reuse code and layout however you
see fit. If you build generic reusable object classes (TablePart,
TabsPart, MenuPart, SelectWidget you get a simple yet powerfull user
interfacing framework.

Henk Verhoeven,
www.phppeanuts.org.
Stijn Goris wrote:
hi all,

I m designing my first 'real' site and want to do things proper this time.
Using dreamwaever and php I was wondering what u guys think of templates in
conjunction with php? Do you think it is the best way to apply my site
design to the entire site or are there better ways?

kind regards
Stijn


Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2549
by: Vince C. | last post by:
Hi all, I've created XML documents that are described with a schema. I'm using those documents to create web pages. All my web pages contain a fixed header and a variable document part. The...
5
2516
by: Tom Alsberg | last post by:
Hi there... I'm recently trying to get a bit acquainted with XML Schemas and XSL. Now, I have a few questions about XSL stylesheets and templates: * Is there a way to "enter" a child element...
22
2143
by: E. Robert Tisdale | last post by:
According to the C++ FAQ Lite: http://www.parashift.com/ What is "genericity"? Yet another way to say, "class templates." Not to be confused with "generality" (which just means avoiding...
12
1947
by: Fabio De Francesco | last post by:
Hello. I can't understand why I can't compile the following simple code, where I think I have applied all the needed rules for templates that are declared and defined in different files (*.h and...
16
16201
by: WittyGuy | last post by:
Hi, What is the major difference between function overloading and function templates? Thanks! http://www.gotw.ca/resources/clcm.htm for info about ]
2
1612
by: jimbo_vr5 | last post by:
Hey I think i've figured out the idea behind apply-templates. But going through the tutorial on <http://www.w3schools.com/xsl/xsl_apply_templates.asp> theres simply just something that i dont...
25
3288
by: Ted | last post by:
I'm putting the posts that follow here (hopefully they will follow here!) because they were rejected in comp.lang.c++.moderated. It behooves anyone reading them to first read the the thread of the...
28
2596
by: NewToCPP | last post by:
Hi, I am just trying to find out if there is any strong reason for not using Templates. When we use Templates it is going to replicate the code for different data types, thus increasing the...
104
4446
by: JohnQ | last post by:
Well apparently not since one can step thru template code with a debugger. But if I was willing to make the concession on debugging, templates would be strictly a precompiler thing? I have a...
7
1694
by: Chris | last post by:
Hi All, This is a weird one but I am hoping someone can help or has some pointers, a recipe how to do the following: I have to move some code from c++ to objective-c and to do this I must...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5579
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1514
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
383
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.