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 Dispatcher Class

The Dispatcher class is provided to the Controller by the ApplicationResources object. We cover a particular implementation in this section, but we have used an abstract base class again to allow for more sophisticated solutions. The abstract Dispatcher class is shown in Listing 24.7.

Listing 24.7. The Dispatcher Class
 1: <?php 2: // controller/Dispatcher.php 3: // qframe license: http://resources.corrosive.co.uk/pkg/qframe/license.txt 4: 5: require_once 'controller/RequestHelper.php'; 6: 7: 8: abstract class Dispatcher { 9: private $views; 10: 11: function __construct( $view_dir ) { 12: $this->views = $view_dir; 13: } 14: 15: abstract function getNext( RequestHelper $helper ); 16: 17: function dispatch( RequestHelper ...

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