http://smarty.php.net), a powerful templating system for PHP. To recap, Smarty provides a separation of program logic from web site design. Your code does whatever it needs to do to fetch, process, and store data, and when you need to display something, you instantiate Smarty and ask it to render a particular template, passing in any necessary data. Smarty templates are written in a simple markup language that looks a bit like a cross between XML and PHP.

" />
x
Loading
 Loading
Hello, Guest | Login | Register

A Smarty Solution

Last month, we looked into Smarty (http://smarty.php.net), a powerful templating system for PHP. To recap, Smarty provides a separation of program logic from web site design. Your code does whatever it needs to do to fetch, process, and store data, and when you need to display something, you instantiate Smarty and ask it to render a particular template, passing in any necessary data. Smarty templates are written in a simple markup language that looks a bit like a cross between XML and PHP.

Last month, we looked into Smarty (http://smarty.php.net), a powerful templating system for PHP. To recap, Smarty provides a separation of program logic from web site design. Your code does whatever it needs to do to fetch, process, and store data, and when you need to display something, you instantiate Smarty and ask it to render a particular template, passing in any necessary data. Smarty templates are written in a simple markup language that looks a bit like a cross between XML and PHP.

Several readers asked to see Smarty in a more concrete, simple example. So, this month, we’ll look at a very simple PHP/MySQL/Smarty application that might be useful to pilots.

Logging

Like programmers, pilots have to worry about logs. The Federal Aviation Administration (FAA) requires all pilots to keep a minimal log, both on the aircraft flown, and on their own flight experience.

Each aircraft a pilot flies may have a log book associated with it. If a plane has a log, each pilot is expected to log her name, the date, the duration and number of flight(s), and any problems encountered with the aircraft along the way. Aircraft owners like it when pilots do their part to keep the records up to date.

Each pilot also logs his flights in a personal log book. The required information is very basic: the date, flight number, aircraft type, flight duration, location of the flight, remarks, and how the flight time was spent:…

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?
Read More
  1. Helpful Tools for Software Developers
  2. The Github Hall of Fame
  3. Book'em, Github.
  4. This Week on Github: Stupid Ruby Tricks
  5. A Veritable Scatter Shot!
Follow Linux Magazine
Rackspace