In addition to recordset bindings, Dreamweaver also makes it easy to create bindings to other variables – you can register variable names in the “Bindings” tab of the “Application” panel, and then simply drag and drop those variable names from the panel into the code editor wbenever you need to manipulate them; Dreamweaver automatically writes the PHP code to echo the current value of the variable to the standard output.
As an example, consider the following example, in which I’ve added three form variables, one session variable and one server variable to the Dreamweaver “Bindings” tab.
I can now access any of these variables in my PHP script simply by dragging them from the “Bindings” tab into the editor window – Dreamweaver automatically writes PHP code to
echo() the current value of the variable to the screen.
If you’re using a large number of common variables in different scripts within your applications – session variables are a good example – this drag-and-drop feature can save you a fair amount of repetitive typing. And that’s always a Good Thing. Now if only Dreamweaver could automatically track variables as I created them and add them to the “Bindings” tab automatically, without me having to manually register them…
Weaving The Web
The thing worth noting about the examples on the previous pages is that I was able to execute them very rapidly, with no actual hand-coding of PHP function calls – Dreamweaver did most of the heavy lifting, with me just clicking my way through menus and dialog boxes. If you’re new to PHP, or just looking for a RAD tool to quickly develop basic PHP applications, Dreamweaver MX, with its built-in behaviors, could be just the ticket to get you up and running in as little time as possible.
That said, while Dreamweaver MX represents a definite evolution in Macromedia’s support for PHP developers, the program is certainly not perfect. Among the things that would help to make the PHP coding experience even more pleasant in Dreamweaver MX: automatic syntax checking, automatic code completion, automatic variable registration and binding, more built-in behaviors, greater PHP toolbar functionality, and support for related plug-in applications (such as the Zend Optimizer). Maybe next time…