Search Engine Optimization Services
 
SEO Link Building Services Articles Genie Magic Web Design Contact Us Seo Tools

 

Wednesday, May 7, 2008

The advantage for programmers is that they write the code in a PHP file without having to combine the instructions with HTML. Also, if the designer changes the layout of a page the programmer doesn't have to change the code to suit the new layout since the functionalities won't change. You perform your work in your files, assign to the templates all the values needed to print on the site and go out for a beer.

The PHP file you need to include the Smarty class
require 'Smarty.class.php'. After that you instantiate the smarty with $smarty = new Smarty.

To assign a variable to the template you need to
$smarty->assign('UserName', 'Jeff Adams'). After everything is finished you call the method and to display the template $smarty->display('index.tpl').

A sample code like this (index.php) :


<php
require 'Smarty.class.php';

$smarty = new Smarty;
$smarty->assign('Username', 'Jeff Adams');
$smarty->display('index.tpl');
?>


The template (index.tpl) like this:

<html>
<
body>
Welcome {$Username}
body>
html>


Also create an array in PHP an pass it to the template:

$tmplate = array ( 'UID'=> '10', &'Name' => 'Jeff Adams', 'Address'=>'Home address');
$smarty->assign('info', $tmplate);

                                Earthlink Netscape Netvouz RawSugar Shadows Sphinn StumbleUpon Yahoo MyWeb

0 Comments:

Post a Comment

<< Home

Previous Posts & Archives
Search Our Site
Featured Links
PageRank 10 sites
Services
 Search Engine Optimization
 Web Design
 Link Building
 Search Engine Marketing
 Internet Marketing
 SEO Consulting
 Ecommerce  Implementation.
 Pay Per Click Services
 Graphic Design.
 Shopping Feeds Optimization.
 Shopping Cart Customization
 Product Development.
 Online Forms & Database       Integration.
 PHP Programming  Services
 Programming Services Java,J2EE
 .NET Application Development      Programming Services
 Business Process OutSourcing
 Offshore Outsourcing
Articles
Company

 

 

 

 

Search Engine Optimization SEO Company | Privacy Policy | Term of Service | Copyright
Search Engine Genie is an Ethical Search Engine Optimization Company Specializing in Search Engine Marketing, Search Engine Promotion and Search Engine Ranking Services.