Learn PHP custom classes Dreamweaver and PHP


show more Understanding PHP custom classes provides you with in-depth training on Business. Taught by David Gassner as part of the Dreamweaver with PHP and MySQL show less
please wait ...

Understanding PHP custom classes

In addition to offering code hinting for PHP language elements, Dreamweaver CS5 also gives you code hinting for custom classes. A PHP custom class is a way of creating reusable code. I'll start by creating a custom class, and then showing you how to use code hinting to use its features. I will be working with the version of files in the exercise files, in a folder named 03_managingcode > 02_hintingwithclasses. I will start in my _includes folder.

I am going to create a custom class that encapsulates, or contains code to output the current time to the web site. I will go to the _includes folder and create a new PHP file. I will right-click on the folder and select new file, and I will name the new file DateUtility.php. When you create a file to contain a custom class declaration, you should always use an uppercase initial character, such as the D in DateUtility. That's a convention that PHP developers use.

Now I will open the file, and just as with a Server Side Include, I will del...

Understanding PHP custom classes
Video duration: 6m 38s 4h 55m Intermediate Updated Jun 12, 2012

Viewers:

Understanding PHP custom classes provides you with in-depth training on Business. Taught by David Gassner as part of the Dreamweaver with PHP and MySQL

Subjects:
Business Developer Web
Software:
Dreamweaver
Author:
please wait ...