Skip to main content
Participant
January 3, 2011
Answered

"Include" and "Require" functions in PHP documents not working in DW CS5 - Need Help

  • January 3, 2011
  • 1 reply
  • 3964 views

In Dreamweaver CS4 when you typed include (" or require (" in a PHP document it would cut you off and give you the choice to manually type the file location or choose to browse for it. It looked like the image below:

In Dreamweaver CS5, which I recently updated too, when include (" or require (" is typed this function does not occur any more. Dreamweaver does not give you the ability to browse for a file and create the path for you like before. This is troublesome because I require on a lot of PHP and hand typing relative paths is time consuming and risky.

Using Insert > PHP object > Include also does not allow me to browse for the file like before.

Am I missing something in the new version? And does anyone know how to fix the problem? I was thinking (And I know its possible but I don't know how to do it) that we could use the code from DW CS4 that handled this before and add it into DW CS5 - since it seems they took it out or forgot it.

This topic has been closed for replies.
Correct answer Randy Edmunds

I could be wrong, but my quick read was based on Randy's explaination, it seems that it was the addition dynamic nature of the code hinting that caused the browse code hint to not work, or forced it to be removed. Make sure to let Adobe keep track of your thoughts on this:

http://www.adobe.com/go/wish/

Danilo


...it seems that it was the addition dynamic nature of the

code hinting that caused the browse code hint to not work,

or forced it to be removed.

I went back and found the old static Code Hint rules from CS4 and tried adding them to CS5, and they no longer work. I suspect they are being overridden by the new dynamic functionality added in CS5.

Sorry for the inconvenience. We are aware of the bug and will try to get it fixed.

Regards,

Randy Edmunds

Dreamweaver Development

Adobe Systems, Inc.

1 reply

Randy Edmunds
Adobe Employee
Adobe Employee
January 5, 2011

In Dreamweaver CS4 when you typed include (" or require (" in a PHP document it would cut you off and give you the choice to manually type the file location or choose to browse for it.

In CS4, all of the Code Hints were static and defined in Configuration/CodeHints/CodeHints.xml. Dynamic PHP Code Hints were introduced in CS5. Try comparing that file between the 2 versions and see if you can find a definition that you can add back in to get that functionality.

Using Insert > PHP object > Include also does not allow me to browse for the file like before.

Try using: Insert > Server Side Include. If should put the correct syntax for the Server model of the page. It seems to use require_once() for PHP, but at least you get the file browse dialog.

Hope this helps,

Randy

L11Author
Participant
January 5, 2011
Randy Edmunds wrote:

In CS4, all of the Code Hints were static and defined in Configuration/CodeHints/CodeHints.xml...

I've looked into this file before but I'll give it another glance. If I'm not mistaken though this does exactly what it says "Code Hints", this file is what controls the hints that pop up and show you how to properly type or format the specific code your trying to do. This file does not however pop up the option to browse for a specific file.

Another example that would really show everyone what I mean is to create and HTML document and type the following:

<link href="

or

<img src="

Once you type this code the following image pops up:

Now this example if for an HTML link or just any other time you type href or src, but Dreamweaver used to do the same thing with PHP's include, require, and require_once.

So does anyone know how we can get this feature working again in CS5? I'm sure once more people update they'll want this feature back too, does anyone know how to make an extension or alter Dreamweavers code to do this? I'd greatly appreciate it.

The tip you gave me is pretty good  though, its a step in the right direction just wish it didn't actomatically put in require_once as well as the PHP tags.

Randy Edmunds wrote:


Try using: Insert > Server Side Include. If should put the correct syntax for the Server model of the page. It seems to use require_once() for PHP, but at least you get the file browse dialog.

Participating Frequently
January 5, 2011

One way you can use the browse dialog from within the code is to type in:

include("

then just after the " right-click on your mouse (or pop up the context menu in your favorite/os way), choose Code Hints -> URL Browser.

Not the greatest, but IMO an acceptable way to work it as I'd rther have the dynamic nature of code hints without that browse, than to have the browse without the dynamic code hints.