When your database contains pointers to images on the server, it does no good to display these filenames to the user, you must put them into image elements that point to the files themselves. This is where data transforms come in.
$tg = new TableGear(array( "database" => array( "username" => "USERNAME", "password" => "PASSWORD", "database" => "DATABASE", "table" => "TABLE" ), "sortable" => ("item", "description", "price", "date", "quantity"), "formatting" => array( "price" => "currency[prefix=$,pad], "date" => "date" ), "totals" => array("price", "quantity"), "transform" => array( "thumbnail" => array( "tag" => "img", "attrib" => array( "src" => "{DATA}", "alt" => "{ASSOCIATED}" ), "associate" => "item" ) ) );
When using transform, each column name or number takes an HTML object. Anywhere within these nestable objects, you can specify the location where you want your data injected with {DATA}. In this example, this has the effect of putting the filenames in the src attribute of img elements where they need to be, instead of just printing them on the screen.
We are also associating the item field to use it as the alt attribute with {ASSOCIATED}. For more information and options, see the documentation.