Dreamweaver CS5 is good news for PHP devs

Book coverSo, Adobe has finally released details of Creative Suite 5, and you’ll be able to get your hands on it at the end of this month. As the author of a forthcoming book on Dreamweaver (Adobe Dreamweaver CS5 with PHP: Training from the Source), I’ve had the opportunity to explore the new features of Dreamweaver CS5 for some time. Here are my thoughts.

When CS4 was released 18 months ago, I described it as the “most significant release of Dreamweaver since Dreamweaver MX ”. To my mind, Dreamweaver CS5 just blows CS4 out of the water. Before I explain why, let me address the negatives. At least three groups of people are going to be disappointed by this new release:

  • Early adopters of HTML5 and CSS3—support is close to zero.
  • Developers of dynamic sites hoping for new server behaviors—there aren’t any.
  • Former users of GoLive—Dreamweaver CS5 hasn’t incorporated any features from GL.

With the debate that has been raging over Apple’s decision to ban Flash from the iPad and iPhone in the name of HTML5 and “web standards”, many will be stunned to learn that the only concession to HTML5 in Dreamweaver CS5 is the option to use an HTML5 DOCTYPE. There’s also no support for CSS3. Has Adobe missed the boat on this? In publicity terms, maybe. In reality, I don’t think so.

HTML5 and CSS3 are still evolving. The current web standards are still HTML 4.01, XHTML 1.0, and CSS2.1. Moreover, Dreamweaver is extensible. Rick Curran has already created an extension for CSS3 code hints. You can also add HTML5 tags to Dreamweaver through the Tag Library. No doubt someone will come up with an extension for that, too. In my view, it would have been a mistake for Adobe to release a half-baked implementation of incomplete standards that are still not supported on all browsers in widespread use.

The other decision that’s likely to cause controversy is the lack of new server behaviors. In fact, some have been removed: CS5 has continued the process of weeding out support for less popular (at least among Dreamweaver users) server-side technologies. JSP and ASP.NET were dropped in CS4. Now, ASP JavaScript has gone, too, although ASP VBScript still survives. There are a few minor security improvements and bug fixes to the PHP server behaviors, but nothing new.

The basic design of the server behaviors is now eight years old, so many people had been asking for new, improved ones, particularly after the decision to drop Adobe Dreamweaver Developer Toolbox (ADDT) last year. Few people realized the significance of that move. This is only my personal opinion, but I think Adobe was sending a clear signal that it’s not in the business of creating server behaviors to automate the generation of server-side code. It’s leaving that market to extension developers like WebAssist, CartWeaver, DMXZone, and others.

So, what is it about Dreamweaver CS5 that I like so much? Lots!

One of the biggest improvements is that Live View now works like a browser. “What’s new about that?” you might think. The difference is that in CS5, the links work. Hold down Ctrl/Cmd while clicking a link, and the target page loads into the Dreamweaver Document window—even if it’s a live page on the internet (assuming, of course, that you’re connected). The Related Files toolbar gives you direct access to the code of all pages linked to the new page. If the target page is on a remote site, the code is read-only; but on a local site, you can edit the code, and press F5 to see the results in Live View. If you want to keep the changes, there’s a new option on the File menu to Save All Related Files.

If you’re still wondering why this is an improvement, just try it with a content management system (CMS) like WordPress, Drupal, or Joomla! As long as you have set up a testing server, you can now view a CMS in Live View. Not only that, Dreamweaver CS5 lets you interact directly with a database. You can test online forms in Live View, inserting database records, updating, and deleting them. Dreamweaver CS5 eliminates the need to make constant round trips to a browser for testing, because the browser is right there in the Document window.

User registration form in DW Live View

Of course, you still need to test pages in a variety of browsers, but you can launch BrowserLab directly from Dreamweaver to test your pages in Adobe’s online service. Up to now, BrowserLab has been free, but it’s being turned into a paid-for service. Your purchase of Dreamweaver CS5 or one of the suites gives you continued free access to BrowserLab and InContext Editing for another year. [Update] Adobe announced today that development of InContext Editing is being terminated. You will be able to maintain existing sites, but the service will cease to exist as a standalone service in 2011. For more details, see the InContext Editing FAQ.

The related files feature now searches for dynamically related files, in addition to those directly linked to the current page. This gives users of WordPress and other CMSs access to the style sheets, which you can edit in Split view or through the CSS Styles panel, seeing the results immediately right inside Dreamweaver. You can even navigate to inside pages of a CMS to style them. And to make it easier to work with CSS, Live View has a CSS Inspect button that highlights block-level elements, padding, and margins in the same way as Firebug—all within the Document window. Another Firebug-like feature is the ability to disable a style rule temporarily by clicking next to the property name in the CSS Styles panel.

WordPress in Dreamweaver CS5

As a PHP developer, it’s the changes in Code view that really excite me. When you start typing a PHP script in Dreamweaver CS5, you’ll immediately notice a red marker in the line numbers column and an alert about a syntax error.

Syntax error alert

Complete the line without errors, and the marker and warning disappear. Dreamweaver constantly checks your syntax on the fly. It doesn’t tell you what the errors are, but it highlights all lines with errors, making the debugging process much quicker. PHP code hints have also been improved dramatically. There’s full support for all core functions, constants, and classes (as of PHP 5.2).

PHP class code hinting

Code hinting is also much smarter. Instead of needing to search through code hints alphabetically, Dreamweaver CS5 searches for substrings. This is helpful when you can’t remember the exact name of function or class—just type the part of the name that you remember, and Dreamweaver includes it in the list. You can also work out your own shortcuts. For example, if you press Ctrl+spacebar and type gesi, the code hints take you straight to getimagesize() by recognizing the ge of “image” and the si of “size”. And in case you don’t know how a function or class works, the official manual page—complete with code examples—appears as a tooltip at the bottom of the selected code hint.

Dreamweaver CS5 code hints for PHP

Incidentally, the smart nature of code hints also applies to style sheets. If, like me, you constantly pick widows instead of width, just type dt—it takes you straight to width.

For serious PHP developers, it gets even better. Dreamweaver CS5 is capable of code introspection, so it builds code hints on the fly for your own functions and classes, as well as for third-party libraries, such as the Zend Framework.

Zend Framework hints

The definition files don’t even need to be directly attached to the page you’re working in. With Site-Specific Code Hints, you tell Dreamweaver where your library files are located, and it scans them for you automatically.

Dialog box

My feeling is that Adobe made the right decisions. HTML5 and CSS3 are not ready for prime time; and server behaviors can offer only a limited number of options if they’re to remain manageable. Site-Specific Code Hints and the improvements to Live View open up a vast new range of opportunities to the beginner and more experienced PHP developer alike. I liked Dreamweaver CS4 a lot, but CS5 is a huge improvement.

Of course, Adobe can’t stop there. CS6 will need to offer solid support for HTML5 and CSS3, but by that time the specification should have settled down and browsers should have caught up.

This entry was posted in Books, CSS, Dreamweaver, PHP. Bookmark the permalink.

123 Responses to Dreamweaver CS5 is good news for PHP devs

  1. Bee Keeper says:

    The following code retrieves database details from my phpcs5.user table okay.
    $host = “localhost”;
    $user = “cs5read”;
    $password = “5T@rmaN”;
    $dbname = “phpcs5”;
    $cxn = mysqli_connect($host,$user,$password,$dbname);
    $sql = “SELECT * FROM user”;
    $result = mysqli_query($cxn,$sql);
    while($row = mysqli_fetch_row($result))
    echo “”.$row[1].”, “.$row[2].””;
    echo “”;

    while($row = mysqli_fetch_assoc($result))
    echo “”.$first_name.”, “.$family_name.”, “.$username.””;

    Using Lesson7 completed files add_user.php, user_registration.php, and library.php.
    I changed $library path to $library = ‘/aplications/MAMP/library/Zend’;
    In the process of trying to add a new user the form input works okay page 244, but Live View produces this when you hold down the Ctrl/Cmd key and click the Sign me up! button:
    Mysqli prepare error: Table ‘phpcd5.user’ doesn’t Exist

  2. Bee Keeper says:

    Bottom of page 225 step 5 Live View says:

    Write OK

    connections are working, so I delete the code in step 5

    added try and catch

    Lesson 7 add_user.php in Live View still says:
    Mysqli prepare error: Table’phpcs5.user’ doesn’t exist

  3. David Powers says:

    The name of the table used in the book and in the accompanying files is “users”, not “user”.

  4. Bee Keeper says:

    Thanks, I’ll check it out!

  5. Bee Keeper says:

    You’re correct, I named the table “user” instead of “users”…what an idiot I am for making this mistake.

  6. w.h.koning says:

    I have created a static website, but this is growing so big now (about 240 files) that it becomes almost unmanagable. Therefore I like to convert it into a dynamic site. I have studied several sources but could not find what I needed.
    Please give me some guidance if possible. What is a good book, a good starting site etc. to help me start. I am using Dreamweaver CS5 and have a localhost setup with Apache, MySql and PHP.

    Thanks in advance

  7. David Powers says:

    If you want to learn how to create dynamic websites with PHP and MySQL, I would recommend getting either my Adobe Dreamweaver CS5 with PHP: Training from the Source or PHP Solutions, 2nd Edition.

    The first book has the advantage that it’s based on Dreamweaver CS5, so you learn to make use of Dreamweaver’s features. However, don’t expect Dreamweaver to do everything for you. The built-in server behaviors that automatically generate PHP code are very old and should be used only for building a prototype of your dynamic website. For a site that’s going to be deployed on the internet, you need to customize the code heavily or create your own. The book devotes only one chapter to the server behaviors. The remaining chapters use the Zend Framework, which is much more robust.

    The second book is software-neutral, and it teaches you how to build dynamic websites by hand-writing PHP code. It also teaches you the basics of database design and SQL, the language used to communicate with databases. It doesn’t teach in a formal way, but through a series of practical projects. The first edition of PHP Solutions is my best selling book, so many people have obviously found it helpful. The second edition brings the techniques up to date with PHP 5.3 and MySQL 5.5 (although it works with PHP 5.2 and MySQL 4.1).

    Whichever route you take – even if it’s not through one of my books – you should be aware that you won’t be able to convert your site over the weekend. PHP and MySQL aren’t difficut, but there’s a lot to learn, particularly with database design. There is no single “right” way to build a database. Be prepared to experiment and learn from your mistakes before committing the entire content of your website to a database.

  8. w.h.koning says:

    Thanks David for your quick response.
    I will purchase ‘PHP Solutions, 2nd Edition’ a.s.a.p.

    The total project will take me as far as I see it now, probably 3 to 6 month, because I like to learn the techiques too and not only following guidance.

  9. Nikwak says:

    David – I had been struggling for DAYS before I found your tutorial on the Adobe web site for installing PHP, mySQL, etc – it went like a breeze – so easy to follow it was a pleasure installing it. However, I have a problem and wonder whether you can tell me if there is a straight forward tutorial somewhere that you know about regarding using the mySQL and phpMyAdmin to allow one of my clients to update a page on her website without having to keep phoning me every day. I have seen sites where you type in the web address followed by ‘admin’ and it takes you to pages that the client can then update but I can’t seem to find the program – the phpMyAdmin site would be too confusing for her. I hope I haven’t waffled on too much and have made some sense. I would be great to have your feedback.
    Thanks for making php more understandable to people like me who have never entered that world before!

  10. I try netbeans, eclipse php, php designer, ultraedit, aptana but dreamweaver is always the best solution to make web site.

  11. Moin Uddin says:

    I restyle a wordpress site and successfully created complete.

    but after creating when i am changing the default permalinks in wordpress to other options it gives an 404 error & when i turned it to default option it works perfect.

    i tried everything, deleting database, deleting wordpress files and copying again but it not fix this problem, i create another site from scratch but the problem remain same, i search on internet and read about .htaccess file but this also don’t work.

    plz help me.

  12. Moin Uddin says:

    I edited a mod_rewrite on httpd.conf on my PC and now its working.
    but when i uploaded my website to my hosting server which is on Parrellels Plesk it only working on default permalinks and as i change links to user friendly it gives error.

    how you created such good SEO friendly urls i coudn’t able to do that.


  13. Pingback: DreamWeaver intro – Programming review

  14. Keith says:

    Was wandering why, Dreamweaver 5.5 still uses mysql_pconnect and NOT mysqli when using the auto code generation (ie; databases, server bavahiors, bindings). I see your books cover mysqli, which is good.

  15. David Powers says:

    Dreamweaver CS5.5 uses mysql_pconnect() because the server behaviors are based on the original MySQL extension, not MySQLi. Apart from a few bug and security fixes, he server behaviors in Dreamweaver have remained essentially unchanged since 2002. I’m not an Adobe employee, but I’m in regular touch with the development team; and I get the feeling that server behaviors are very low down on their list of priorities. I don’t expect the server behaviors to be updated soon, maybe not ever.

    Dreamweaver CS5 made massive improvements to support for PHP with full code hinting for PHP 5.2 (CS5.5 now supports PHP 5.3), code introspection, and autocompletion. Using site-specific code hints, you can now work in Dreamweaver with third-party frameworks, such as the Zend Framework and Symfony. The unspoken message coming from Adobe is that Dreamweaver offers support for a variety of web technologies to developers/designers who are willing to write their own code. The same policy has been applied to JavaScript. The Spry widgets haven’t been removed, but CS5.5 now has full code hinting for jQuery, opening up far more possibilities, but also requiring the developer to use his or her own skills. No software can hold your hand the whole way. Anyone who expects Dreamweaver to do so is using the wrong program.

  16. Minilik Tesfaye says:

    Dreamweaver CS5.5 is a very wonderful IDE to develop web applications. I was wondering if I can use dreamweaver to customize applications developed in different frameworks like symfony. Please give me a link or tell me how I can customize such applications.


  17. David Powers says:

    I haven’t worked with symfony, but Dreamweaver’s site-specific code hints work a treat with Zend Framework. There’s a video on Adobe TV explaining how to set up site-specific code hints.

  18. Tony says:

    If Adobe is not interested in server behaviours, why did the buy up Interakt only to close it down. I am stuck with Dreamweaver 8 with the MX Kollection extension because I haven’t the time or energy to begin all over again. That means, however that I have to wead out php coding errors ‘by hand’ sometimes wasting ages searching for an error

  19. David Powers says:

    Tony, I don’t work for Adobe, so I don’t know the official reason for buying InterAKT. But Adobe didn’t close it down. The InterAKT engineers are now working on a wide range of other Adobe projects. Both InterAKT and Adobe are businesses, whose job it is to make money. If Adobe hadn’t bought InterAKT, there’s no guarantee that InterAKT would have remained in business. Even if InterAKT had remained independent, there’s no guarantee that it would have continued to produce MX Kollection.

    Technology changes. Some products and companies are successfull. Others go out of business. If you’re still relying on a product that’s no longer supported, you’re putting your own business at risk.

    I invested a lot of money in a major project that relied on ASP shortly before Microsoft decided to abandon development in favour of ASP.NET. After about a year, I realized I had bet on the wrong horse, and that switching to ASP.NET wasn’t practical. That’s what prompted me to learn to hand-code PHP. It wasn’t easy, but the time and effort I invested was one of the best decisions I have ever made.

    It’s painful being forced to change as a result of circumstances over which you have no control, but there’s no point in being bitter about it. Channel your energy into moving on. Good luck.

  20. Tony says:

    Yes, but who would trust Microsoft?
    PHP isn’t going to disappear suddenly because it is not at the mercy of a commercial outfit of that ruthlessness.
    Actually your ‘excuse’ for Adobe makes them sound as predatory as Microsoft; they bought up a software company to get the engineers.
    Actually the MX Kollection was pretty good value for money, I don’t think it was a question of being an unsuccessful product. The classes still work of course, I would just loose the wizards if I migrate to CS5, which would mean learning to use them with hand coding; ah well! eventually I will have to buckle down and do it.

  21. David Powers says:

    Yes, it’s possible that Adobe bought InterAKT just to get the engineers. But don’t forget that MX Kollection was re-released as Adobe Dreamweaver Developer Toolbox (ADDT), and it remained on sale with updates for new versions of Dreamweaver for about two years. In the end, it didn’t sell well enough to justify continued development. Even though it fulfilled an important need for you, it obviously didn’t appeal to enough other developers. Bad marketing? Too much of a niche product? Combination of both? I don’t know.

  22. Tony says:

    I actually love coding php by hand (its just a hobby for me)
    I created http://www.early-keyboard.com/maps/museums-try.php
    just for the fun of it using (procedural) php and javascript.
    However, a site created with MX Kollection such as my wife’s:
    is a tangle of interacting classes, which I would find intimidating to work on without the help of the MX Kollection wizards.

  23. Ashley Briscoe says:

    If dreamweaver site specific code hints work well with zend, can they be set up to work with other frameworks like Code Igniter. I can’t find any information on setting up different frameworks, can they be done the same way as zend