TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-14-2008, 03:03 PM   #1 (permalink)
The Addict
 
webtuto's Avatar
 
Join Date: Dec 2007
Location: morocco
Posts: 221
Thanks: 19
webtuto is on a distinguished road
Default what is SMARTY

hi
i always heard about SMARTY AND WHEN I DOWNLOAD A SCRIPT I SEE SMARTY FOLDER
so can someone tell me what is SMARTY ???
__________________
Send a message via MSN to webtuto Send a message via Yahoo to webtuto Send a message via Skype™ to webtuto
webtuto is offline  
Reply With Quote
Old 01-14-2008, 03:51 PM   #2 (permalink)
The Addict
Top Contributor Good Samaritan 
 
Join Date: Jan 2008
Location: USA
Posts: 217
Thanks: 16
RobertK is on a distinguished road
Default

Smarty is what is known as a "template engine". In other words, if you put all your data-gathering in one place you can then send the information for a page to the templates you make with Smarty, and get a page generated neatly every time. Some template engines slow you down, but Smarty's templates actually compile into PHP, so there is little difference if you use them or not. Just more flexibility to your interface without changing your backend code.
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
RobertK is offline  
Reply With Quote
Old 01-14-2008, 04:02 PM   #3 (permalink)
The Addict
 
webtuto's Avatar
 
Join Date: Dec 2007
Location: morocco
Posts: 221
Thanks: 19
webtuto is on a distinguished road
Default

yeah thanks but from i see that SMARTY help you mix php with the design right
and if so how to do that plz
__________________
Send a message via MSN to webtuto Send a message via Yahoo to webtuto Send a message via Skype™ to webtuto
webtuto is offline  
Reply With Quote
Old 01-14-2008, 03:56 PM   #4 (permalink)
The Contributor
 
buggabill's Avatar
 
Join Date: Jan 2008
Location: Maine, USA
Posts: 92
Thanks: 2
buggabill is on a distinguished road
Default

Best way to find out what anything is: Google.
Type 'define:Smarty' (without the quotes) into a Google search box and get this page: Google definition of smarty with links

In short, Smarty is a web template system written in PHP. Smarty separates PHP, as a business logic, from HTML, a presentation logic, and generates web content by the placement of special Smarty tags within a document (i.e. variable substitution).

I have never used it though.
__________________
-- Bill
"Why is it drug addicts and computer aficionados are both called users?" -Clifford Stoll
buggabill is offline  
Reply With Quote
Old 01-14-2008, 04:12 PM   #5 (permalink)
The Addict
Top Contributor Good Samaritan 
 
Join Date: Jan 2008
Location: USA
Posts: 217
Thanks: 16
RobertK is on a distinguished road
Default

That's too complex for us to just teach you, I'd suggest you read the documentation that comes with smarty: Smarty : Documentation
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
RobertK is offline  
Reply With Quote
Old 01-14-2008, 04:15 PM   #6 (permalink)
The Addict
 
webtuto's Avatar
 
Join Date: Dec 2007
Location: morocco
Posts: 221
Thanks: 19
webtuto is on a distinguished road
Default

ok thanks robert ;)
but smarty is to mix php with the design ?
__________________
Send a message via MSN to webtuto Send a message via Yahoo to webtuto Send a message via Skype™ to webtuto
webtuto is offline  
Reply With Quote
Old 01-14-2008, 04:16 PM   #7 (permalink)
The Addict
Top Contributor Good Samaritan 
 
Join Date: Jan 2008
Location: USA
Posts: 217
Thanks: 16
RobertK is on a distinguished road
Default

Yes and no, it has its own language and syntax that then gets interpreted, by SMARTY, into PHP. You only mix the design and the display, not the data gathering.
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
RobertK is offline  
Reply With Quote
Old 01-14-2008, 04:43 PM   #8 (permalink)
The Addict
 
webtuto's Avatar
 
Join Date: Dec 2007
Location: morocco
Posts: 221
Thanks: 19
webtuto is on a distinguished road
Default

anyway thanks
;)
__________________
Send a message via MSN to webtuto Send a message via Yahoo to webtuto Send a message via Skype™ to webtuto
webtuto is offline  
Reply With Quote
Old 01-14-2008, 08:01 PM   #9 (permalink)
The Acquainted
Upcoming Programmer 
 
CMellor's Avatar
 
Join Date: Sep 2007
Location: Leeds, UK
Posts: 141
Thanks: 6
CMellor is on a distinguished road
Default

Basically you have your PHP and your HTML separate from each other, which makes it easier to edit.

You make your HTML file, and a lot of people give it the file extention .tpl, which stands for 'template', which is what it is.

Then in the PHP file, you would do something like this to show the HTML page via the PHP page.

PHP Code:
<?php
include('location/to/Smarty.inc.php');
$smarty = new Smarty;

$smarty->display('temp_file.tpl');
?>
But I recommend reading the documentation, it is very helpful.
__________________
Not quite a n00b...
CMellor is offline  
Reply With Quote
Old 01-15-2008, 12:22 AM   #10 (permalink)
The Addict
 
webtuto's Avatar
 
Join Date: Dec 2007
Location: morocco
Posts: 221
Thanks: 19
webtuto is on a distinguished road
Default

hi thanks man for the tips im gonna read the documentation that will help me mix the php and design
__________________
Send a message via MSN to webtuto Send a message via Yahoo to webtuto Send a message via Skype™ to webtuto
webtuto is offline  
Reply With Quote
Old 01-15-2008, 12:28 AM   #11 (permalink)
The Addict
 
Join Date: Nov 2007
Posts: 264
Thanks: 2
TlcAndres is on a distinguished road
Default

Well what SMARTY does is separate the php and design, but I'm guessing you get the basic idea anyways.
TlcAndres is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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


All times are GMT. The time now is 07:39 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design