Working with Related PHP Files

As discussed on Advanced Formatting Options, Dreamweaver provides a special toolbar for identifying files associated with a web page, such as an external style sheet or a JavaScript file. This “related files” toolbar not only shows you which files have been added to a page, but, with just a click of the mouse, it lets you jump directly to the code for that file. Dreamweaver considers server-side includes “related files” too, so you can easily edit an SSI by clicking its name in the toolbar.

In fact, server-side programming often involves adding lots of files to a page: files for connecting to a database server, for running a database query, for sending email, and more. For example, the popular blogging system WordPress uses a single file, index.php, to control an entire blog—this one file manages every one of the blog’s pages, from the home page to a category page to a single blog post. To do this, the index.php file includes tons (really, a lot) of other PHP files. If you’re using a program other than Dreamweaver, the only way to edit a WordPress site is to open each file individually. Dreamweaver, however, can “discover” related PHP files and display them in the Related Files toolbar for easy access. To do this, you need to follow a few steps:

  1. Open a PHP file.

    If you use the Insert Server-Side Include command discussed previously, Dreamweaver automatically sees these PHP files and displays them in the Related Files toolbar with no further effort on ...

Get Dreamweaver CS6: The Missing Manual now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.