Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
hiya everyone... templates...
Old 06-10-2005, 05:53 PM hiya everyone... templates...
-_darkranger_-'s Avatar
Super Talker

Posts: 122
Location: bolton...
Trades: 0
hiya everyone

i have made lots of html templates... but i dont no how to put the templates in using php... pwease help... you no you wanna help me ^-^

xx thx in advance for any replies
-_darkranger_- is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-10-2005, 06:01 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
Thats very vague, perhaps I will be too...

PHP simply outputs HTML.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 06-10-2005, 06:13 PM
-_darkranger_-'s Avatar
Super Talker

Posts: 122
Location: bolton...
Trades: 0
ok then... i have made some templates (for example i made a nav template that has the html code for the nav in it and saved it as a html doc) but i want to put all the templates together to make a web page... i dont no how to explain it properly...
-_darkranger_- is offline
Reply With Quote
View Public Profile
 
Old 06-10-2005, 06:33 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
Theres a couple of ways to accomplish this, the wrong way and the right way....(I know this will start a debate with someone :shrug )

The wrong way:
Use php includes to include the navigation portion within your html where you want it...

PHP Code:
<td><?php include 'nav.html'?></td>
The right way is to use a template engine like smarty and completely abstract your php logic from your html markup. Look into http://smarty.php.net for examples of this.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 06-11-2005, 02:48 AM
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
http://smarty.php.net/
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 06-11-2005, 02:48 AM
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Hmm, I was not the first who mentioned smarty.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 06-15-2005, 05:32 AM
Average Talker

Posts: 28
Trades: 0
I'm just starting on this intergration line myself, why would using the include be wrong?
__________________

Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
e-vange is offline
Reply With Quote
View Public Profile
 
Old 06-15-2005, 07:44 AM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
Quote:
Originally Posted by e-vange
I'm just starting on this intergration line myself, why would using the include be wrong?
The best thing you can do your future development as a php developer is to learn to use a template engine first. A lot of people call this too much overhead but it is really not.

Over there on the left underneath my avatar is a link that say's to view my blog articles or something like that, click on it and read the article I wrote about template engines.

edit: nevermind I think we got rid of the blog in favor of the new article site coming soon.

Here is a link to read instead....http://smarty.php.net/whyuse.php

Keep in mind many people will say just the opposite of what that page says. And although I do agree that smarty if very bloated it's one of the very few projects that completely abstracts your business logic from your design elements and even allows you to use looping within your templates in order to utilize one template rather than multiple templates (Xoops does this quite effectively).
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Last edited by Republikin; 06-15-2005 at 07:47 AM..
Republikin is offline
Reply With Quote
View Public Profile
 
Old 06-16-2005, 07:54 AM
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
Trades: 0
So is everyone here a Smarty user?

I took a look at it once while reading "Industrail Strength MVC" at http://www.phparch.com/sample.php?mid=10. (About patterns (MVC pattern at that, intersting read for you hard core lot "I mean that too").

Anyway my point is that Smarty is not the only template engine out there, Xtemplate is my fav but they all do the same thing (some heavy some light) but the end is the same.

Ibbo
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Linux user #349545 :
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCf
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
Old 06-16-2005, 05:59 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
I honestly never use Smarty myself although if I were to release some sort of public project I probably would. I tout it as a good system mainly for its popularity, it is a part of so many projects and so many people have worked with it that I think it is ideal for people new to php templating.

I usually use a template engine that is private source written by our very own Chroder (he's brilliant by the way). It's extremely lightweight, provides caching, conf files and basic programming constructs. I've never really found a need for anything else.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 06-17-2005, 12:28 PM
-_darkranger_-'s Avatar
Super Talker

Posts: 122
Location: bolton...
Trades: 0
i dont no how **** to do anything with smarty... *is confuzled*
-_darkranger_- is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to hiya everyone... templates...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.80589 seconds with 12 queries