473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 2860

"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
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
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
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
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
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
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
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
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
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...

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.