A special controller known as
a front controller is responsible for routing all requests to the appropriate
controller and returning the response.
To help you better understand the dynamics of an MVC-driven framework, the
following example works through a typical scenario involving the converter application,
highlighting the role of each MVC component:
1. The user desires the application to perform an action??”for instance, converting
an input temperature from Fahrenheit to Celsius. The user then submits the
form by clicking a submit button.
2. The controller responds by identifying the appropriate action, gathering the
input, and supplying it to the model.
3. The model executes the function responsible for converting Fahrenheit to Celsius
and returns the calculated value to the controller.
4. The controller calls the appropriate view, passing along the calculated value. The
view renders and returns the result to the user.
CHAPTER 24 ?– MVC AND THE Z END F RAMEWORK 605
The next section introduces four PHP-driven frameworks, each offering its own
similar but unique MVC implementation.
PHP??™s Framework Solutions
While PHP has long been perfectly suited for development the MVC way, no prominent
solutions emerged until the success of Ruby on Rails (http://www.rubyonrails.org/)
began turning the spotlight away from the language long known as the reigning king of
Web development.
Pages:
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691