PHP Code Hints

Dreamweaver includes advanced code-hinting for the server-side programming language PHP (but not for other server-side technologies, like .NET, ColdFusion, Java Server Pages, and Ruby on Rails). Not only does Dreamweaver support code-hinting for built-in PHP functions, it also makes note of variables, functions, and classes that you create (see Figure 22-8).

Dreamweaver is pretty unforgiving of syntax errors (typos or missing punctuation) in PHP code. Most of the time, you start typing PHP code and Dreamweaver displays a yellow “there is a syntax error” bar along with a red mark at the point it thinks you made an error. Don’t worry, this happens a lot as you program; the important thing is that, once you finish, there’s no syntax error message. If there is, you probably left off a closing ), },‘, or “.

Figure 22-8. Dreamweaver is pretty unforgiving of syntax errors (typos or missing punctuation) in PHP code. Most of the time, you start typing PHP code and Dreamweaver displays a yellow “there is a syntax error” bar along with a red mark at the point it thinks you made an error. Don’t worry, this happens a lot as you program; the important thing is that, once you finish, there’s no syntax error message. If there is, you probably left off a closing ), },‘, or “.

Since it’s common for programmers to create multiple PHP files and then add them all to (or include them all in) a master file, Dreamweaver CS6 searches through all the files referenced in the current working file and analyzes them. Then, as you type more PHP code, Dreamweaver displays code hints based on the names of the variables, functions, and classes you defined in those files. In other words, Dreamweaver personalizes its code hints for your site and for the PHP programming you added to it.

In addition, since many PHP frameworks, like CakePHP and Zend, ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.