Difference between revisions of "Web Frameworks - Workbook - Week 02"

From mi-linux
Jump to navigationJump to search
Line 46: Line 46:
 
</pre>
 
</pre>
  
Now that the project is created, the main artifacts to begin understanding are the bootstrap, configuration, action controllers, and views.  
+
One last thing before we can start working: you need to set the permissions so you can browse to your files from a web browser... this command will do the trick:
 +
 
 +
<pre>
 +
chmod 755 quickstart2 -R
 +
</pre>
 +
 
 +
Your project is now created and accessible:
 +
http://mi-linux.wlv.ac.uk/~0123456/quickstart/public/
  
 
== The Bootstrap ==
 
== The Bootstrap ==
  
 
Your Bootstrap class defines what resources and components to initialize. By default, Zend Framework's Front Controller is intialized, and it uses the application/controllers/ as the default directory in which to look for action controllers (more on that later). The class looks like the following:
 
Your Bootstrap class defines what resources and components to initialize. By default, Zend Framework's Front Controller is intialized, and it uses the application/controllers/ as the default directory in which to look for action controllers (more on that later). The class looks like the following:

Revision as of 11:48, 19 January 2010

Main Page >> Web Frameworks >> Workbook >> Workshop - week 01

Install Zend Framework

Zend is already installed on mi-linux, so you don't have to worry about that... However if you wish to install it at home, please see this page

Create Your Project

Open a terminal (command window if you are working on Linux, Putty if you are working from Windows). Navigate to a directory where you would like to start a project (in this case your public_html folder). Then execute the following:

% zf.sh create project quickstart

Note: "quickstart" is the name of your project... you can call it anything you like! (but avoid spaces please).

Running this command will create your basic site structure, including your initial controllers and views. The tree looks like the following:

quickstart
|-- application
|   |-- Bootstrap.php
|   |-- configs
|   |   `-- application.ini
|   |-- controllers
|   |   |-- ErrorController.php
|   |   `-- IndexController.php
|   |-- models
|   `-- views
|       |-- helpers
|       `-- scripts
|           |-- error
|           |   `-- error.phtml
|           `-- index
|               `-- index.phtml
|-- library
|-- public
|   `-- index.php
`-- tests
    |-- application
    |   `-- bootstrap.php
    |-- library
    |   `-- bootstrap.php
    `-- phpunit.xml

One last thing before we can start working: you need to set the permissions so you can browse to your files from a web browser... this command will do the trick:

chmod 755 quickstart2 -R

Your project is now created and accessible: http://mi-linux.wlv.ac.uk/~0123456/quickstart/public/

The Bootstrap

Your Bootstrap class defines what resources and components to initialize. By default, Zend Framework's Front Controller is intialized, and it uses the application/controllers/ as the default directory in which to look for action controllers (more on that later). The class looks like the following: