Other common files that are accessed directly are images,
CSS and JavaScript files, so each has their own sub-directory within the web_root directory.
Now that we have an overview of the directory system used by a Zend Framework website, we can
proceed to add the files required to create a very simple application that displays some text on the page.
2.5 Hello World: File by File
To create a simple Hello World application we need to create four files within our directory structure: a
bootstrap file, an Apache control file (.htaccess), a controller file and a view template. A copy of the Zend
Framework itself needs to be added to the library directory. The final program will look as shown in Figure
2.3.
Figure 2.3: A minimal Zend Framework application requires a bootstrap file, a controller and a view working together to produce the
text ???Hello World!???.
2.5.1 Bootstrapping
Bootstrapping is the term used to describe starting the application up. With the Front Controller pattern, this
file is the only file needed in the web root directory and so is usually called index.php. As this file is used for
all page requests, it is used for setting up the application??™s environment, setting up the Zend Framework??™s
controller system and then running the application itself as shown in listing 2.
Pages:
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47