Prev | Current Page 688 | Next

W. Jason Gilmore

"Beginning PHP and MySQL: From Novice to Professional"

In its most basic
form, this structure looks like this:
Web server document root/
index.php
application/
modules/
default/
controllers/
views/
scripts/
This structure opens up the possibility to manage multiple hosted MVC applications
within the same location. In a situation where multiple MVC applications exist,
you would add additional module directories under the modules directory. However,
for the purposes of the examples in this chapter, a single (default) application will
be used.
Therefore, a simple Web application might be structured as follows; note that there
are three controllers, each of which matches up to a corresponding view directory:
Web server document root/
index.php
application/
modules/
default/
controllers/
IndexController.php
BookController.php
AboutController.php
views/
footer.phtml
header.phtml
scripts/
about/
contact.phtml
index.phtml
612 CHAPTER 24 ?–  MVC AND THE Z END F RAMEWORK
book/
index.phtml
toc.phtml
index/
index.phtml
Don??™t worry about the oddly named files and structure too much at this point. Just
understand that, based on the provided controllers and views and a typical configuration,
the following URLs would work:
http://www.example.com/
http://www.example.com/about/
http://www.example.com/about/contact/
http://www.example.com/book/
http://www.example.com/book/toc/
Because this directory structure won??™t suit every developer, it??™s possible to change
the default settings; however, coverage of this feature is out of the scope of this chapter.


Pages:
676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700