PhpED: PHP IDE
new features
features
version comparison
features: php tools
php debugger
php profiler
php frameworks
php scripts
features tour
licensing
php testing
PhpED difference
PhpED on Mac/Linux
testimonials
PhpDock
Nu-Coder
PhpExpress
TechPlatform

PHP Smarty

PHP Smarty engine is an implementation of PHP Templates. PHP Template is a great way of separation of business logic and presentation layers. Since PHP Smarty templates became very popular with PHP Programmers, PHP IDE should be expected to support syntax color highlighting for PHP Smarty templates. PhpED excels at this. In this tutorial you will learn how to configure syntax highliting for PHP Smarty in PhpED. This illustration shows Smarty .tpl file opened in PhpED. PHP Smarty in PhpED

How to configure PHP Smarty

You can setup syntax color highlighting for PHP Smarty template files by selecting Tools->Editor->Syntax Colors. PhpED provides unique flexibility of User Interface settings. To setup PHP Smarty settings, select Smarty from Language drop down box. You can specify the style you want PHP Editor to use when it displays.

  • Smarty Strings
  • Smarty Numbers
  • Smarty Functions
  • Smarty Variables
  • Smarty function parameters
  • Smarty output modifiers
  • Smarty operators
  • Smarty boolean constants
  • Non-Smarty Text
  • Matched Brackets and much more
You can specify the following elements of PHP Smarty display:
  • Foreground color
  • Background color
  • Italic, Bold and Underline
The following illustration below show PHP Smarty template setting dialog in PhpED.
PHP Smarty settings in PhpED

How to run PHP Smarty

You can execute PHP Scripts using PHP Smarty templates just like any other PHP Scripts right from PHP IDE. Our example PHP code instantiates Smarty class and makes a number of calls to Smarty assign() function to substitue the values of Smarty's variables. Final call to Smarty display method accepts the name of Smarty Template file to display. Please take a look at this PHP Code using PHP Smarty. PHP Smarty code in PhpED
To execute the script you need to:
  • Open the script in PhpED's PHP Editor
  • Select Run or Run in Debugger if you want to use PhpED's PHP Debugger to step through PHP Code
  • The output of the Run will be displayed in PhpED's embedded browser or external browser, dependant on your settings
The following illustration shows the out put of sample PHP Smarty script.
PHP Smarty output in PhpED

How to Debug PHP Smarty

Debugging of PHP Smarty scripts is made easy with PhpED's best in class PHP Debugger. For example, when you load the script using Smarty in PhpED and select Run in Debugger, you will be able to
  • Step through and step into the PHP Smarty classes code
  • See the values being assigned to Smarty variables
  • Change the values of Smarty variables on the fly
  • Inspect the content of PHP Smarty classes and much more
For example, the illustration below shows debugging stepping into Smarty.class.php of PHP Smarty classes with PhpED's PHP Debugger.
Debugging PHP Smarty in PhpED

In this tutorial you learned about the many features of the PHP Smarty syntax color highliter and how to use them to quickly develop PHP Smarty applications. Additional technical information is available from the NuSphere Forum. Download a free trial of our PHP IDE with full PHP Smarty support today!

 Download NuSphere PHP IDE

Download a free trial of the fast PHP EDitor and robust Integrated Development Environment for PHP.

 Buy NuSphere PhpED® now

Best PHP Editor and complete PHP IDE.
NuSphere PhpED 21.0 is available from our online store front.
"To be honest its bloody awesome, I have looked at loads of PHP editors and this is THE only one that actual works straight out of the box!!! Brilliant, well done."
Andrew Breward,
Director of Technology
caboodal.com

 Guide

Walk through NuSphere PhpED interface
PhpED video tutorial: Webservices
Learn how to add webservices to your code in less than 5 minutes (a flash demo).

 Special Team4 Offer

Get 4 copies of PhpED for the price of 3!

Optimum solution for development teams.
PhpED 21.0 Team4
Need more than 4 licenses? Contact Us for more quantity discounts, please use "Ordering/Payment issue" subject on the form.

 Dr. Dobb's

Dr. Dobb's

Dr. Dobb's Magazine covers NuSphere PhpED in New and Noteworthy section.

 InfoWorld

infoworld.com
PhpED is a proper, world-class IDE for PHP code. It is the only IDE worth considering if PHP development is your primary job