Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
Join author David Gassner as he describes how to add dynamic data to a PHP-enabled web site in Adobe Dreamweaver. This intermediate course shows how to plan and create a MySQL database, define a PHP-enabled site in Dreamweaver, connect the site to the database, and manage and present dynamic data. David also explores Dreamweaver features such as PHP custom class introspection and site-specific code hinting as well as the differences between the CS5 and CS6 versions of the software.
This course was updated on 6/12/2012.
The new code hinting features in Dreamweaver CS5 allow you to integrate third- party, open source frameworks, and then using site-specific code hinting, you can configure Dreamweaver to allow you to do code hinting on the classes in these frameworks. Dreamweaver is preconfigured to work with three major frameworks. You can get to this feature through the menu by selecting Site > Site-Specific Code Hints. If you pull down the list under Structure, you will see that there are structures already in place for Drupal, Joomla!, and WordPress.
I'll show you in this video how to install another third-party library called Zend Framework, which contains a lot of really valuable PHP extensions, and then I will use a few of these extensions throughout the course. Click Cancel to close the Site- Specific dialog and then take a look in the exercise files, under 03_managingcode. If you don't have access to the exercise files, no worries. I will provide a web site URL in a moment and show you where you can download it. If you do have access to the exercise files, locate the ZendFramework folder and copy it to the Clipboard.
Then create a new folder on your system. I am going to create the folder right under my C drive and I am going to name it phpincludes, and then I will paste the ZendFramework folder into place. Now if you don't have access to the exercise files, you can download the Zend Framework from this web page: framework.zend.com/download. On this page, I will click on the Latest Zend Framework Releases link and then this is the link that I downloaded from, Zend Framework Minimal Package.
There are a number of different links here, including the full package, the minimal package which I am using, and the Zend framework documentation. Extract the file that you download, copy the file to the appropriate place, and then name your folder the same as I have named mine, ZendFramework. The next step is to configure your PHP environment to use the Zend framework. If you are working on Windows with WampServer, go to the system tray icon for WampServer, then go to PHP and then load the file php.ini.
It will open in a text editor, such as Notepad. If you are working on Mac with MAMP, here is how you can find out which php.ini file you are using. Go back to Dreamweaver and then create a file called phpinfo.php, where the code is very simple. It just has the simple phpinfo command. Run the page on the server through Live View or through an external browser and then take a look in the resulting output at the loaded configuration file.
This will tell you exactly which copy of php.ini your PHP server is using, and then once again open it in any text editor. Now let's return to the php.ini file. Look for a setting called include_path. I'll press Ctrl+F - I am working in Notepad - and I will type include_path. If you are working on Mac in a text editor, press Command+F and then do the same thing. The first include_path you will find isn't the one you are looking for; it's in a comment section.
So search again and this time you should find your way to the include_path settings. There are two, one for UNIX and one for Windows. If you are working on Windows, uncomment the include_path setting, and delete the C:\php\includes, leave the dot semicolon, and then include your ZendFramework folder like this, C:\ phpincludes\ZendFramework\library.
You'll point to the library folder, and then in your PHP pages, you will explicitly include files from the ZendFramework, starting with the folder Zend and then walking down to the file you want to include. I will save that change. If you are working on Mac with MAMP, it will look like this. I have a copy of the Mac version of this file in this folder, so I'll open it in Dreamweaver. Once again, I will search for include_ path and in the MAMP version, you will see that the include_path is already uncommented, and all you need to do is point it to the appropriate folder.
You should keep the setting that's in there - don't delete it - but on UNIX you separate the directories from each other with the colon character, not the semicolon. And then after you have made all of the changes to your php.ini files, you'll need to restart your server. For Windows, I will go to the WAMP Server Admin menu, and I'll choose Restart All Services. If you are working with MAMP, go to the MAMP application and once again restart your servers. So configuring Zend Framework is as simple as copying the ZendFramework file somewhere on your hard disk, and then changing the include_path in your PHP ini file.
Once you follow those steps, you are ready to start using the Zend Framework, and in the following video I will show you how to set up site-specific code hinting, so you can easily use the framework's classes.
Find answers to the most frequently asked questions about Dreamweaver with PHP and MySQL.
Here are the FAQs that matched your search "":
<?php include('../ZendFramework/library/Zend/Date.php'); ?
<?php echo $_SERVER['DOCUMENT_ROOT']; ?
You can then programmatically modify the include_path variable at runtime with the set_include_path() function. For example, if your physical root folder is /home/myroot, the code might look like this:
<?phpset_include_path('.' . PATH_SEPARATOR .'/home/myroot/ZendFramework/library/Zend');include('Date.php');?
Sorry, there are no matches for your search ""—to search again, type in another word or phrase and click search.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.