| 
		
			
			
				
			
			
				 
			
			
				
			
		 | 
		
			
			
				 
			
				
			
		 | 
	||||
| 
				Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.  You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us.  | 
		
		 
		![]()  | 
	
		
			
  | 	
	
	
		
		|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. | 
| 
		 | 
	Thread Tools | 
| 
			
			 | 
		#1 | 
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: Jun 2002 
				
				
				
					Posts: 871
				 
				
				
				
				 | 
	
	
	
	
		
			
			 
				
				[PHP] Hard Coded versus Template Engine
			 
			What would you prefer and why? 
		
	
		
		
		
		
		
	
	I started a iscript and know i hear my client wants hard coded content in the PHP File. Im trying him to change his mind but he is sure. I disagree on this because its a total mess and not easy to work with in the further. Just checking what people use this days. Im using template engines since 6-7 years ago.  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: Apr 2004 
				Location: Toronto, ON 
				
				
					Posts: 1,706
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 I would recommend templates. If a customer is set on hard coded content, explain to them why it's bad. 
		
	
		
		
		
		
			If they still insist on it - they are the customers so you have to do what they ask. If it takes longer to maintain you just charge them by the hour. 
				__________________ 
		
		
		
		
	
	  315-310
			 | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Join Date: Aug 2002 
				Location: Sydney, Australia 
				
				
					Posts: 6,103
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 We're left TEVS as hard code as it gives more freedom for webmasters to change it to how they want it. Some of the things iv seen I don't think you could ever use with a template system. 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
	---  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#4 | 
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: Aug 2007 
				
				
				
					Posts: 128
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Sounds like you've never really used a template system. 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
	230-699  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#5 | 
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Join Date: Jul 2002 
				Location: Bay Area 
				
				
					Posts: 4,012
				 
				
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#7 | 
| 
			
			
			
			 Bland for life 
			
		
			
			
			Industry Role:  
				Join Date: Nov 2004 
				
				
				
					Posts: 10,468
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 1) Give them hard coded files.   
		
	
		
		
		
		
			2) When it's time to update charge them an hour. 3) Client Bitches 4) Tell them you'll have to re-code it for a template system 5) Charge Them 10 hours 
				__________________ 
		
		
		
		
	
	★★★ 
			 | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#8 | 
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Join Date: Jan 2006 
				Location: Gringo in Puerto Rico 
				
				
					Posts: 4,204
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 It really depends on the amount of traffic the site is going to be getting.  Template systems are costly to performance sometimes. 
		
	
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#9 | 
| 
			
			
			
			 Will code for food... 
			
		
			
			
			Join Date: Apr 2001 
				Location: Buckeye, AZ 
				
				
					Posts: 8,496
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Somebody once said, PHP actually is a template system. 
		
	
		
		
		
		
			When you add another template system on top, you are creating an additional layer. With new syntax, additional learning curve and more limitations. I haven't met a person who can learn a template engine syntax (like Smarty or whatever), but can't learn the php syntax. p.s. I'm not personally against using template systems, I just have mixed feelings about it. 
				__________________ 
		
		
		
		
		
			
		
		
	
	 
			 | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#10 | 
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: May 2005 
				
				
				
					Posts: 2,737
				 
				
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#11 | |
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: May 2005 
				
				
				
					Posts: 2,737
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
  | 
|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#12 | 
| 
			
			
			
			 Do Fun Shit. 
			
		
			
				
			
			
			Industry Role:  
				Join Date: Dec 2004 
				Location: OC 
				
				
					Posts: 13,393
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 A lot of schools of thought on this one... 
		
	
		
		
		
		
			Here's my take. Good code is good code, bad code is bad code... and there's a shitload of variance in between. Strip your function pages from your layout pages... That's just retard mode basics. Beyond that if a templating system such as smartys is going to allow you better cache/delivery options (a lot of subsequent db calls, looping code, whatever), and quicker updates use it... If per the project it's not a necessity, why code for shit that doesn't need to be coded for? 
				__________________ 
		
		
		
		
	
	![]() “I have the simplest tastes. I am always satisfied with the best.” -Oscar Wilde  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#13 | 
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Join Date: Aug 2002 
				Location: Sydney, Australia 
				
				
					Posts: 6,103
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 I have over 500 clients using over 1000 domains and not 1 complaint with my system. 
		
	
		
		
		
		
			Im sure those people will disagree with you - par a few. 
				__________________ 
		
		
		
		
	
	---  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#14 | |
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: Jun 2003 
				Location: Belgium 
				
				
					Posts: 444
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
 ![]()  | 
|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#15 | 
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Industry Role:  
				Join Date: Sep 2006 
				
				
				
					Posts: 1,542
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 We was doing hardcoded for many years until the greatness of template engines came upon us.. And you still thinking to do hardcoded??? 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
	------ Offcourse its a dude posting here. Probably a fut ugly one too. Fuck still people falling for this 100 year old trick  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#16 | |
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Join Date: Aug 2002 
				Location: Sydney, Australia 
				
				
					Posts: 6,103
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
 He wanted the code to the admin files which we ZEND. The front end is raw (no template). 
				__________________ 
		
		
		
		
	
	---  | 
|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#17 | |
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: Jun 2003 
				Location: Belgium 
				
				
					Posts: 444
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
 ![]()  | 
|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#18 | |
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Join Date: Jan 2003 
				
				
				
					Posts: 583
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
 I don't see any reason to change the way TEVs is doing things. 
				__________________ 
		
		
		
		
	
	 | 
|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#19 | 
| 
			
			
			
			 ICQ: 197-556-237 
			
		
			
			
			Join Date: Jun 2003 
				Location: BRASIL !!! 
				
				
					Posts: 57,559
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Template Engine is good! 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
	I'm just a newbie.  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#20 | |
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Join Date: Aug 2002 
				Location: Sydney, Australia 
				
				
					Posts: 6,103
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
 
				__________________ 
		
		
		
		
	
	---  | 
|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#21 | 
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Industry Role:  
				Join Date: Oct 2002 
				Location: Toronto, ON 
				
				
					Posts: 5,247
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Clean smarty templates are much easier to edit if you don't understand PHP at all. 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
	ICQ: 91139591  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#22 | 
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Join Date: Jan 2005 
				Location: Stockton 
				
				
					Posts: 4,365
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Templating is the way to go if your using a CMS 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
	ICQ:268731675  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#23 | 
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Industry Role:  
				Join Date: Jun 2004 
				Location: New York, NY 
				
				
					Posts: 6,890
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Well Hans, I'm sure you already know my opinion  
		
	
		
		
		
		
			Smarty is the way I'd go for any PHP site I create. My main reasons: - Multi-lingual sites become much cleaner/easier (esp. with a few custom hacks to the smarty class allowing you to use the {l} tag) - Seperating code and html/design makes things cleaner and easier to work on in future. - When you want to ship off your templates for a redesign, it's a lot easier to have a designer not screw up your few simple smarty tags than working through your php code - WAP applications as well as other functionality is made much easier with Smarty's functions I'm sure there are tons of other reasons I could think of if the above wasn't enough. 
				__________________ 
		
		
		
		
	
	Skype variuscr - Email varius AT gmail  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#24 | 
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Industry Role:  
				Join Date: Aug 2006 
				Location: Poland 
				
				
					Posts: 9,229
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 I REALLY dislike template engines, and I prefer to create header/footer files and seperate my php code from the html as much as possible. 
		
	
		
		
		
		
			If a user can type {$title} in a template, they can just as easily type $row[title]. When doing loops, more people know and understand how to do them in PHP then in smarty. 
				__________________ 
		
		
		
		
	
	Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#25 | 
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Join Date: Feb 2005 
				Location: SD/OC/LA 
				
				
					Posts: 1,917
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 there a couple questions involved before the decision of hard coded or template comes into play.  There is a time and place for both. 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
	=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=   Warriors come out  to plaAAaayyy! ![]() =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#26 | 
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Join Date: Nov 2005 
				Location: Manila Philippines 
				
				
					Posts: 170
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 I recommend templates. It's simple and can save lots of time. 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
	Sig too big http://www.gofuckyourself.com/gfy_faqs.html Want to use a large banner in your sig??? Contact Eric about getting on as an advertiser - eric AT adult.com  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#27 | 
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Join Date: Dec 2007 
				Location: Chatsworth, CA 
				
				
					Posts: 1,964
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Depends on what you mean.  Generally design should be separate from code.  This is a basic principle of MVC that has been established as a best practice for more than a decade. 
		
	
		
		
		
		
			
		
		
		
		
	
	However, just because someone doesn't use a template doesn't mean they aren't separating their design from their code. There are many more ways than templates to accomplish this. In fact, I rarely use templates because I find them very inefficient (from a development standpoint), the only exception is when I need to expose template type functionality to an end user where they will be coming up with a different design on a daily basis (like email newsletters or something). The books "The Pragmatic Programmer" or "Code Generation" have some good ideas of other ways to go about things. I highly recommend them.  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#28 | |
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Join Date: Dec 2007 
				Location: Chatsworth, CA 
				
				
					Posts: 1,964
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
  | 
|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#29 | |
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Industry Role:  
				Join Date: Jun 2003 
				Location: Costa Rica 
				
				
					Posts: 1,953
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
 
				__________________ 
		
		
		
		
	
	Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com  | 
|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 |