 |
 |
 |
 |

Developing With Dreamweaver®
If you currently use Dreamweaver® for web development and you want to use it to develop your VConsole application, then you are in luck. It just so happens that we have created a full Developers Toolkit for Dreamweaver that makes developing applications on VConsole much easier. In fact, we recommend using the VConsole Developers Toolkit for Dreamweaver to create your application over manually coding your files.
You should start off by downloading and installing the VConsole Developers Toolkit For Dreamweaver Extension
This toolkit can be installed using the Adobe Extension Manager. The toolkit is free of charge and is distributed under the GPL license. No warranty is given (nor implied) with this extension. You also agree not to hold us responsible for any losses this software may cause due to software bugs, or any other reason.
Once you have downloaded and installed the extension, simply restart Dreamweaver® and you are ready to start developing. So what does the Developers Toolkit give you? Here is a list of what you get when you install the extension.
- Additional Code Coloring. There are a lot of VConsole PHP functions. And the best way to know one when you see one is by its color. If you manually code in a VConsole PHP function, it should show in purple. So now, when coding your VConsole PHP files, you should know a VConsole function when you see one. (For a list of all the PHP functions and what they do, see PHP Functions)
- PHP Code Hints. OK, so now you can recognize a VConsole PHP function when you see one, but how do you know what parameters to pass to it? Well, you could check the reference or you could simply look at the PHP code hints. Whenever you type in a VConsole PHP function, you get code hints that tell you what parameters to pass and what type of data is expected for a particular parameter. The code hints work just like any of the other PHP functions in Dreamweaver®. Here is a quick example of what you may see when typing in a VConsole PHP function:
check_email(string email, varref &error[, bool dnscheck=true])
In this example, you can see that the check_email() function requires 2 parameters and has 1 optional parameter. The first parameter: string email expects a string. The second parameter expects a variable which may contain data after the function returns (varref). And the third parameter expects a boolean value which should be true or false but defaults to true. If a parameter is enclosed in brackets, then it is optional. You will also see an equal sign on optional parameters which tells you the default value of that parameter if you do not pass anything. Optional parameters will always be at the end of the parameter list. Each parameter will consist of a data type (like string, varref, or bool), then a space, then a single descriptive word of what the parameter is (like email, &error, or dnscheck), then an optional default value which is denoted by =value. And, if the data type is a choice, then a list of valid choices separated by pipes | will be given as well. There is 1 more thing. Pipes | may be used to give a choice of multiple possible data types or multiple possible parameter names. A pipe | anywhere in a code hint means OR. OK, let's try a couple more examples:
currency(float amount[, choice type='USD' USD|NUM|USTR])
In this example, there are 2 parameters, the first is required, the second is optional (enclosed in brackets). The first parameter (amount) should be a floating point number and the second parameter (type), if given, should be either USD, NUM, or USTR. If not given, the second parameter defaults to USD.
send_email(string|array to, string subject, string body[, string from=false][, string fromname=false][, string altbody=false][, bool html=false][, string|array attach=false])
In this example, there are 8 parameters. All the previous rules apply, except on the first and last parameters. The first and last parameters can be either a string or an array. (denoted by string|array)
Here is a list of all the data types and what they mean:
- string - The parameter is expected to be a string.
- int - The parameter is expected to be an integer or whole number.
- bool - The parameter is expected to be true or false. You can pass any value, but the only thing that matters is if it evaluates to true or false.
- varref - The parameter is expected to be a variable. This variable may be populated, overwritten, or modified by the function and can be read and used once the function returns.
- array - The parameter is expected to be an array. What the array should contain or the structure of the array depends on the function and you have to check the documentation determine what the array should contain.
- float - The parameter is expected to be a floating point number. Basically any number with or without a decimal point.
- choice - The parameter is expected to be 1 of a predefined set of choices. The valid choices are shown in the code hint.
- arrayref - The parameter is expected to be an array. This array may be populated, overwritten, or modified by the function and can be read and used once the function returns. Again, you will have to reference the documentation to see what the array should contain, or what it will contain once the function returns.
- regex - The parameter is expected to be a regular expression that can be passed to the PHP function preg_match() as the first parameter.
- mixed - The parameter is expected to be a variable, an array, a multi-dimensional array, or an object.
- void - No parameters are expected
- Additional Tools. OK, so now you can recognize VConsole PHP functions and you can see at a glance what parameters those functions require, but how about actually doing things like creating modules, creating actions, and creating the data structures that VConsole expects? Well, you now have a full set of tools to do just that. You will notice in your Dreamweaver Application that you have a new VConsole drop down menu at the top. You can use this menu to do things like create modules, create actions, insert datamanager fields, insert filters, insert actions, create wizardmanager fields, propertiesmanager tabs, and more. You will learn more about what all these things are as you go along, so we won't go into too much detail here. Here is a summary of how all this works.
- You use the drop down menu to create a new module. Let's say that it is a datamanager module. This will create all the necessary files that you module depends on. And those files are already pre-coded and are heavily commented.
- Now you open up one of the files so that you can customize it to your needs. You then see a comment that says something like: // You must insert at least 1 field below this line. Place your cursor below this line and select Insert Datamanager Field from the VConsole menu.
- OK, so you place your cursor below that line and select Insert Datamanager Field from the VConsole menu. You are now shown a dialog box with a bunch of fields that let you configure how you want the field to behave and what type of field this is.
- So you fill out the fields in the dialog box and click on OK. Viola. The toolkit has now inserted the correct PHP code for your field with all the correct parameters. (No need to look it all up).
- Now you see another similar comment. You do what it says and you get more PHP code that is already formatted correctly for you.
- When you are all done, simply save your file and VConsole handles the rest. You can literally create a fully functional module in a matter of minutes.
- Do you want to create data management modules, or smart wizards, or how about property windows with tabs? The VConsole menu can do it all for you. And since the whole thing is coded in PHP, you can easily modify to meet your needs.
Using the VConsole Developers Toolkit for Dreamweaver is a must have for any VConsole developer.
NEXT: About VConsole Modules
COMMENTS There are no comments at this time.
|
|
 |
 |
 |
|