I made a framwork for my company that develops using php.
It would be nice to not always having to explain the use of functions, implement dreamweaver, possibly through an extension, the intellisense for these functions.
for example when using the shell function require me indicates that the function accepts a string. in the case of mysql_connect are advised to enter the host name etc..
It would be very important to implement something like this for my functions
is it possible?
Yes, it's possible.
For CS4, you'll have to write some XML for the intellisense. Take a look in the Configuration/CodeHints/ folder for examples.
Starting in CS5, you'll automatically get intellisense for PHP. Also new in CS5, you can write XML to get additional information displayed below the vode hints list. I'm not exactly sure how that's done, and the CS5 Extensibility Docs haven't been released yet, so look in the CodeHints folder to see if you can figure it out.
Adobe Systems, Inc.
thanks for the reply.
I analyzed the file codeHints on php but I can not get what I want. I am doing tests on cs5 version.
I inserted the following code in the file
<Function pattern = "today (string $eng)" doctypes = "PHP_MySQL" displayrestriction = "PHP_Script" icon = "shared / mm / images / hintFunction.png" casesensitive = "true" MMString: source = "php / CORE" description = "@ # php_CORE3.xml mysql_connect" />
in new php file i put
when i type today(...
the intellisense show me $a not 'string $eng'....
the problem may be caused by
MMString: source = "php / CORE" description = "@ # php_CORE3.xml mysql_connect"
I do not think because from what I understand this is the explanation of function and not the intellisense
thanks a lot in anycase
I'm not sure I understand all the issues you're having, but I'll try to reply... ask again if you have more questions.
If you want to offer codehints for your own framework, the best thing is to simply use the "site-specific codehints" tool. You can create a "preset" with your framework, which can then be exported & imported by other users. For most of the usecases, I think this should be probably all that you need to do.
Now, there are cases where the default engine might not recognize all the hints that you want to offer (e.g. you have global variables defined using extract() ); it is still possible to add those hints, but it's somewhat more complicated, ask again if you need help (as a starting point - you can look at the "Drupal" presed for codehints, it references a file in your "user configuration" directory). BTW, the "builtin" CMS codehinting presets are defined in [Config folder]/Shared/Dinamico/Presets - look there how Drupal is described, and you can easily make a similar description for your own framework (and install it as an extension together with other support files if needed).
Now - if you wish to add description tooltips for your hints (like those for the builtin php hints) - this is again possible, but, unfortunately, not so easy as it could've been (*). However, if you wish to add those , it's entirely feasible: just look at the way the builtin hints are defined (basically, you need to prefix your function/class/ class member/ variable/etc. with a comment that says something like "/** @file_name.xml#description_tag */; the "file_name.xml" is located in the folder CodeHints/Descriptions, if I'm not wrong - look there for how the tooltips are described; it's basically a list of key-value pairs, with the "key" being the "description_tag", and the value is the (escaped) HTML content of your tooltip). Unfortunately I don't have access to a Dreamweaver installation right now so I can't tell you for sure, but if you can't handle it ask again and I'll give more details tomorrow.
Finally, about the "today" function: as I understand it, your framework redefines a builtin PHP function - and you'd like the codehint to change, too? I can't tell for sure that it will work, without trying... but if you add in the "site-specific codehints" a file that contains your definition of "today", it might override the builtin. If it doesn't work (and in fact, I'm afraid that it won't work) - then your only options are (A) disable the builtin "mysql" hints from the options, or (B) manually (or through an extension) rewrite the file that declares the hints for "today" so that you remove that function.
Hope that helps,
thanks for the reply and sorry if I have not been replicated. I was too busy with work.
The use of "specific suggestions for the site" meets my requirements.
Therefore I solved the problem.
For more complicated things return to a later stage where I am less busy.