O'Reilly logo

Sams Teach Yourself PHP in 24 Hours, Third Edition by Matt Zandstra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The CommandFactory Class

An instance of the CommandFactory class is provided for the Controller class by the ApplicationResources object in Listing 24.1 on line 19. The Controller could instantiate its own CommandFactory, but by delegating object creation to the ApplicationResources object, we provide it the opportunity to configure the CommandFactory for us.

You can see the CommandFactory class in Listing 24.4.

Listing 24.4. The CommandFactory Class
 1: <? 2: // command/CommandFactory.php 3: // qframe license: http://resources.corrosive.co.uk/pkg/qframe/license.txt 4: 5: require_once 'controller/ApplicationResources.php'; 6: 7: 8: abstract class CommandFactory { 9: abstract function setDefaultCommand ( $str ); 10: abstract function getDefaultCommand ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required