View Full Version : Advantages and Disadvantages of php templates
Hello, 1)) I was wondering what are the advantages and disadvantages of php templates.
2))Can someone help me set up a php template for the following page, considering that this page is my index.php page. http://www.athletes4excellence.com/layout.php . Please and thank you!:)
Removed ugly formatting.
tech_support
01-14-2008, 12:40 AM
1)) I was wondering what are the advantages and disadvantages of php templates.
Advantages
- Easy to maintain
- Less time wasted if you needed to change one script
Disadvantages
- Time-consuming when you're converting
- Can't work in DW properly.
2))Can someone help me set up a php template for the following page, considering that this page is my index.php page. http://www.athletes4excellence.com/layout.php . Please and thank you!
Read, learn, repeat until fully understood.
http://www.dynamicdrive.com/forums/showthread.php?p=125609
- Time-consuming when you're convertingNot a disadvantage of using a template though -- that's a disadvantage of using something else and then switching to templates.
- Can't work in DW properly.Again, a disadvantage of DW, not templates.
Read, learn, repeat until fully understood.
http://www.dynamicdrive.com/forums/s...d.php?p=125609As I posted in the thread, that's not as powerful or elegant as a real templating engine such as Smarty (http://smarty.php.net/).
Twey, I do not understand that link you gave me.
What's in it? Also, where do I get a nice php template?
thetestingsite
01-15-2008, 01:57 AM
What do you mean by
where do I get a nice php template?
Go to the Smarty (http://www.smarty.net/crashcourse.php) website and learn how to make up the template files (which is just plain html with some simple variables in the form of {$var}). After that, assign the variables in your script and display the template.
Hope this helps.
I don't understand. Is the one that tech_support wrote a good one? Should I use it, also if I were to use it "the final code" that he has up, is it the "index.php" page and how would the normal pages would look like? Please and thank you!
As I said, that method of doing things isn't as powerful as using a real templating engine. tech_support's is an example of one inferior method of doing it. On the Smarty website you can find examples and documentation of how to do it using Smarty.
Are there setup php templates on the web that can be used? Please and thank you. Something exactly like this, http://www.pixel2life.com/ except I want the menu with sub menu tabs and taking out the search engine. Again thank you so much I appreciate the help!
Ok, let me make this more simple. Is there a php template that I can get that has menu/with tabbed submenus (horizontal), with header, 2 columns (left 80%, right 20, and 2 footer columns. The layout that I want is 100%. Please help and thank you so much. I appreciate the help.
BLiZZaRD
01-19-2008, 07:31 PM
http://www.phpwebtemplates.com/
http://www.google.com/search?hl=en&q=php+templates&btnG=Google+Search
Or better yet.. open notepad and write your own! :)
Is it legal to use some other websites template but completely customizing it. As a test, I used this, is it ok if keep using it? Please and thank you.
BLiZZaRD
01-20-2008, 02:52 PM
If you are in doubt, contact the site owner and ask permission. Do it in writing so you have a copy for your records.
Thanks! Also, doesn't Dreamweaver have setup php templates? Do you suggest me using them? Please and thank you.
tech_support
01-21-2008, 01:15 AM
No they don't.
Really? When I go to "New" and Select what new thing I want, there is php templates...
tech_support
01-21-2008, 01:45 AM
There is PHP Layouts. There's a difference.
Ohh, uhh, what's the difference. Sorry, for my mistake. Please and thank you.
tech_support
01-21-2008, 04:45 AM
PHP Layouts: http://www.dynamicdrive.com/style/layouts/
Aren't PHP layouts same as HTML, or anyother type? Please and thank you.
EDIT: There are PHP templates in Dreamweaver CS3 (blank though). Are they worth trying?
tech_support
01-21-2008, 05:08 AM
No and no.
Ok thanks! As for your "PHP Templates Tutorial", the final code is the "index.php", however, how would the "other pages" would look like? Please and thank you.
tech_support
01-21-2008, 06:41 AM
Your other pages should just contain the code between the <body></body> tags, like this:
<h2>My Header</h2>
<p>Content content content content content.</p>
See the code? There's no <head>,<body>,<html> and a <!DOCTYPE>. Just your content.
Thanks, also what would I name it? If I name it for example test.php and my index is index.php, would it be automatically index.php?test.php? Please and thank you.
thetestingsite
01-22-2008, 05:45 PM
if your content was on test.php, then you would call it by index.php?p=test if you are using tech_support's script.
Hope this helps.
Thanks, and how does the title part work? Please and thank you.
tech_support
01-23-2008, 10:03 AM
Have you tried reading that part? It's pretty basic stuff y'know.
Ahh I see. What's with the "inc"? Do I have to make a folder, if yes, how come?
Can you please tell me how this would look like it this was my index page. http://www.athletes4excellenc.com/indexxxx.php . Please and thank you.
boogyman
01-23-2008, 06:12 PM
inc is shorthand for include. The term was developed as a way to alert the person that this is a template that will be brought (included) into some other file.
Most notably are your generic files that you wish to use on every page of your site but do not wish to code them directly into every page. Some examples are the header and footer, and depending on the structure your navigation.
It is not mandatory that you use an inc file or folder, it is mearly just a means of letting yourself of content contained within it.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.