2. Errors in the templates are confined to the Smartys error handling routines, making them as simple and intuitive as possible for the designer.
3. With presentation on its own layer, designers can modify or completely redesign it from scratch, all without intervention from the programmer.
4. Programmers aren't messing with templates. They can go about maintaining the application code, changing the way content is acquired, making new business rules, etc. without disturbing the presentation layer.
5. Templates are a close representation of what the final output will be, which is an intuitive approach. Designers don't care how the content got to the template. If you have extraneous data in the template such as an SQL statement, this opens the risk of breaking application code by accidental deletion or alteration by the designer.
6. You are not opening your server to the execution of arbitrary PHP code. Smarty has many security features built in so designers won't breach security, whether intentional or accidental. They can only do what they are confined to in the templates.
Replace username with your exact username.
Create a folder named smarty in your root directory.Create and copy into smarty(the folder you just created) the following four folders. 1.templates_c
2.templates
3.configs
4.cache
Stoer all your template files in the second folder(templates).
To demonstrate how this is gonna work let us see an example below. Create the the following php file named rusumo.php
<?php
$name = "Msafiri";
$surname ="Rusumo";
$city = "Las Vegas";
$phone = "Not available";
$country = "USA";
//Calling smarty template engine.
// put full path to Smarty.class.php
require('/home/username/public_html/libs/Smarty.class.php');
$smarty = new Smarty();
//$smarty->use_sub_dirs = true;
//$smarty->debugging = false;
$smarty->template_dir = '/home/username/public_html/smarty/templates';
$smarty->compile_dir = '/home/username/public_html/smarty/templates_c';
$smarty->cache_dir = '/home/username/public_html/smarty/cache';
$smarty->config_dir = '/home/username/public_html/smarty/configs';
$smarty->assign('name',$name);
$smarty->assign('surname',$surname);
$smarty->assign('city',$city);
$smarty->assign('phone',$phone);
$smarty->assign('country',$country);
$smarty->display('rusumo.tpl');
? >
<html>
<head>
<title> Installation of smarty on hosting account</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<table>
<tr>
<td>Name:</td><td></td>
</tr>
<tr>
<td>Surname:</td><td></td>
</tr>
<tr>
<td>City:</td><td></td>
</tr>
<tr>
<td>Phone:</td><td></td>
</tr>
<tr>
<td>Country:</td><td></td>
</tr>
</table>
</body>
</html>
Now you can test you codes. If you get any error don`t hesitate to contact me, I am always available to help you free of charge. To contact me just click on contacts and send me a message.
Ni hivi hizi kodi unaziandika kwa mkono ama ni programu maalumu imeshaandaliwa? mbona nyingi sana..
moms016 hizi kodi unaandika kwa mkono wala sio ngumu,pengine kwa vile hujawahi kuandika ndio maana unaziona nyingi,lakini ni rahisi sana kama utaamua kujifunza.
Ebwana Msafiri sana TU mzee. nimekusoma mtu wangu
sema msafiri kafiri,nimekukubali kijana.mbona page ya muziki inaleta rabsha?ama mambo bado?
Yap nimejaribu na inaonekana km ulivyosema ila zinahitaji majaribio mengi. Anyway asante kwa majibu.
MOMOS016 kwanza unajua computer mzee au mwenzangu mimi najua kuwasha na kuzima ndiyo maana unaona mimi siulizi yangu macho tu, Mzee rusumo unatisha unaoneka unaijua Tarakilishi (computer) kama baskel
Kaka i have gone through ur web... its nice.. but most of the people like the web to be graphically..and that is how u gona gat more views on your web..jus try to make it attractive ..some animation Im sure u know how is gona look like...Man really najisikia wivu mzee.. my wish its was one day to create my own website without any one hand..i stard.. VB..SQL..MY SQL..ORAQLE..LINUX..ila kaka mpaka sasa niko patupu mzee.. and wot i beliave now.. i cant do anything unajua ukiwa na majukumu na wish kurudu college and stard that stuff ila wapi mzee.. mda umeisha .. Any way how is turky is that poor country ??? i have seen so many turkish they are comming in my country to work..
THANS MAN FOR BEING A THINK TANK OF OUR NATION WE WILL SUPPORT YOUFOREVEER