Tech Insight !

Technical blog on ASP.Net, PHP, Web Development, Web hosting , Database Programming
Home » Archive by category 'My SQL'

Using Smarty with PHP: A PHP Template Engine

December 18th, 2009 Posted in My SQL, PHP, Web Developement Tags: , ,

Most of the time in site development, first the designer makes the interface and breaks into HTML for developer and then developer starts by creating simple scripts to add dynamic features to their Web sites. In real time practice some or more changes are required by client, which increases complexity because of PHP and HTML in same page. And another problem is that developer has to wait until designer completes design and HTML layout.

Why Use Templates?

Template process is quite valid and useful, and most developers who uses this method, agree that the separation of business logic and layout logic makes the code a lot easier to understand and maintain. This is the reason behind templates, to separate business logic from layout.

Advantages of smarty

Smarty is a new development concept in the PHP, and it brings also several new and unique features. One of the mail advantages is that Smarty ‘compiles’ the parsed templates into PHP scripts, and then reuses the compiled template when required. This brings a huge performance improvement over other template solutions, as the main PHP script doesn’t need to parse and output the same template on every request.

Smarty also allows developers to create their own set of functions and have Smarty recognize them. And it also has built-in caching support and special constructs that can be used on templates to control the format of the layout.

And very importantly, Smarty provides developers’ tools that help them separate the business-logic code from the layout-formatting code. And Smarty goes one step further by allowing developers to put control-flow structures in the template source. This might sound a bad idea, since it would imply business-like logic in the template, but it is actually quite useful. You can tell Smarty to use a specific style for any html control on the template itself, instead of having PHP code do this work. After all, this is template-related information.

Installing Smarty

Smarty is quite simple to install. You can get various versions available for download Smarty.

After downloading and extracting the files, copy the resulting Smarty directory to some place inside your include path. A good option is to copy this directory in the PEAR library directory. In UNIX environments, it will usually be:

$ cp -R Smarty /usr/local/lib/php/

In Windows computers, you will need to copy the Smarty directory to ‘C:\php\pear’.

Give write rights to Apache user for template directory and sub directories. This is the directory that smarty uses to store compiled templates.

Using Smarty

Now you have write simple PHP script to manipulate and assign template variable to a value. Like..

<?php

 require 'Smarty.class.php';
 $smarty = new Smarty; 
$smarty->assign("variable_name","Variable Value");
$smarty->display('display.tpl');
?>

Above script includes the Smarty class, which is included in Smarty.class.php. After that object is created for smarty class and the template variable named $ variable_name  will hold the value " Variable Value".
At the time of creating templates, the placeholders will be placed as {$variable_name}, but the placeholder delimiter can also be changed. {$variable_name} will be replaced by its value and output to the browser. Smarty also compiles the template into a PHP script, so the next time this script is requested, the template will not be parsed again and the compiled PHP script will be used instead.

Summery

Also Control Flow statements, conditions can be used in smarty. Smarty works for designers and developers both and also can reduce development and maintenance time. One has to just go through syntax used for smarty and it will make your work easier.



NOTE :

If you are in need of any Web Development feel free to Inquire us . Dhanashree Inc. Expertise in Asp.net Development, Php Development, Website designing, Open Source customisation. Dhanashree Inc can be our offshore development company / outsourcing web development company, hire dedicated web programmers.

Above information is for knowledge sharing if you have problem / issue / suggestion please intimate us with details for proper and prompt action.

10 PHP Open source Ecommerce Framework

December 16th, 2009 Posted in My SQL, PHP, Web Developement Tags: , , ,

Electronic commerce, commonly known as e-commerce or eCommerce, consists of the buying and selling of products or services over electronic systems such as the Internet and other computer networks. The amount of trade conducted electronically has grown extraordinarily since the spread of the Internet. A wide variety of commerce is conducted in this way, spurring and drawing on innovations in electronic funds transfer, supply chain management, Internet marketing, online transaction processing, electronic data interchange (EDI), inventory management systems, and automated data collection systems. Modern electronic commerce typically uses the World Wide Web at least at some point in the transaction’s lifecycle, although it can encompass a wider range of technologies such as e-mail as well.

Experience the most comprehensive software as a service (SaaS) ecommerce solution available today. Target explosive growth with a solution that combines over 250+ award-winning ecommerce software features with a highly customizable web storefront, enterprise-class site hosting (99.9% uptime), and a robust shopping experience for customers. Give your customers the best shopping experience with the latest social media and web 2.0.

Online shopping, an important component of electronic commerce was invented by Michael Aldrich in the UK in 1979. The world’s first recorded B2B was Thomson Holidays in 1981

ü The first recorded B2C was Gateshead SIS/Tesco in 1984

ü The world’s first recorded online shopper was Mrs. Jane Snowball of Gateshead, England

ü During the 1980s, online shopping was also used extensively in the UK by auto manufacturers such as Ford, Peugeot-Talbot, General Motors and Nissan.

ü All these organizations and others used the Aldrich systems. The systems used the switched public telephone network in dial-up and leased line modes. There was no broadband capability.

There are 10 PHP Open source Ecommerce Framework.

image002Zen Cart

Zen Cart truly is the art of e-commerce; a free, user-friendly, open source shopping cart system. The software is being developed by group of like-minded shop owners, programmers, designers, and consultants that think e-commerce could be and should be done differently. Some solutions seem to be complicated programming exercises instead of responding to users’ needs, Zen Cart puts the merchant’s and shopper’s requirements first. Similarly, other programs are nearly impossible to install and use without an IT degree, Zen Cart can be installed and set-up by anyone with the most basic computer skills. Others are so expensive … not Zen Cart it’s FREE!

Zen Cart will deliver the ultimate online shopping experience to your customers. Navigating through your merchandise offerings is a breeze with Zen Cart, the program provides several “Spotlight” lists in addition to the traditional category to product links. Once a product is added to the shopping cart, secure checkout is a simple 3-step process. After providing the billing information, your customer chooses the shipping method. (Multiple shipping methods including real-time internet shipping quotes are built-in) Next, a payment type is chosen from one of the popular payment modules. (Pay Pal and AuthorizeNet are just 2 of the included modules) Last, the customer reviews the order, shipping and payment choices, and confirms the order. You are immediately notified of the order and your customer automatically receives an e-mail confirmation.

Zen Cart gives web designers a robust and customizable electronic storefront that’s easy to keep up-to-date with new features. It provides usable, intuitive and unobtrusive purchase flows right out of the box based on proven industry best-practices – there are no major revisions required to get things right for your clients!

One of the secrets behind its power lies in our robust template system that “abstracts” the look-and-feel from the code and logic behind Zen Cart. This enables you to give clients a truly custom solution that integrates quickly and perfectly with their existing marketing websites.

image004OsCommerce

OsCommerce is the leading Open Source online shop e-commerce solution that is available for free under the GNU General Public License. It features a rich set of out-of-the-box online shopping cart functionality that allows store owners to setup, run, and maintain their online stores with minimum effort and with no costs, license fees, or limitations-involved.

The goal of the osCommerce project is to continually evolve by attracting a community that supports the ongoing development of the project at its core level and extensively through contributions to provide additional functionality to the already existing rich feature-set.

Everything you need to get started in selling physical and digital goods over the internet, from the Catalog front-end that is presented to your customers, to the Administration Tool back end that completely handles your products, customers, orders, and online store data.

image005CartStore Shopping Cart Software

CartStore is a sophisticated ecommerce platform that was built for actual real ecommerce websites. It has been in development since March of 2000. It was forked from the osCommerce project in 2006 where extensive development and modernization occurred.

image007Eclime – E-Commerce Jet Engine

CartStore is a sophisticated ecommerce platform that was built for actual real ecommerce websites. It has been in development since March of 2000. It was forked from the osCommerce project in 2006 where extensive development and modernization occurred.

image009Freeway
Freeway is the most advanced Open Source eCommerce platform and includes an array of features not found in extremely expensive commercial systems. Without having to purchase a commercial system and then paying a developer to build custom installation, Freeway does most of what you need out of the box. For example, instead of getting dragged into purchasing an overpriced products based system and having a developer struggle for weeks and eventually fail to force products sales into event sales, Freeway already support events AND services AND subscriptions.

image011Magento

Magento is a new professional open-source eCommerce solution offering unprecedented flexibility and control. Magento was designed with the notion that each eCommerce implementation has to be unique since no two businesses are alike. Magento’s modular architecture puts the control back in the hands of the online merchant and places no constraints on business processes and flow

.

image013OpenCart

OpenCart is an open source PHP-based online shopping cart system. A robust

E-commerce solution for Internet merchants with the ability to create their own online business and participate in e-commerce at a minimal cost.

image015OsCSS

OsCSS web standard compliant open source online shop. The design structure is based on a template system, easily customizable and build on CSS / XHTML

image017PrestaShop

Despite its technical sophistication and advanced functionality, the PrestaShop e-Commerce Solution is very light (around 2 MB not including translation files), so it’s easy to download, install, and update.

PrestaShop is so lightweight and speedy, even customers with slow connection speeds will enjoy buying from you!

image019OXID eShop

OXID eShop Community Edition is proven and flexible open source software. With its modular, state-of-the-art and standards-based architecture, customization is easy.

The above article is respected to share knowledge not commercial use.



NOTE :

If you are in need of any Web Development feel free to Inquire us . Dhanashree Inc. Expertise in Asp.net Development, Php Development, Website designing, Open Source customisation. Dhanashree Inc can be our offshore development company / outsourcing web development company, hire dedicated web programmers.

Above information is for knowledge sharing if you have problem / issue / suggestion please intimate us with details for proper and prompt action.