Quick Start Guide
Pre-Reqs
Before attempting to install the Zoop framework, please make sure you have a recent version of PHP installed (minimum PHP 4.4.8+, we recommend the most recent stable version of PHP 5) and working both from the command line and with a web server.
Steps
- Download the Zoop Framework and unpack it anywhere. We recommend a good conventional shared location -- perhaps /usr/local/, which we'll use in the rest of this example -- but any location will do. Users testing the framework on shared hosting may choose to put it under their home directory.
- Open a command shell. Within any web-available directory in which you wish to create your new application, type the following:
-
php /usr/local/zoop/zoop_create.php project hello
(Or, if you've placed zoop elsewhere: php /your/path/to/zoop/zoop_create.php project hello )
Check the directory listing after the script runs succesfully. You should see a folder/directory named "hello."
Open the directory "hello." Upon viewing a directory listing, you should see:
GuiControls config includes.php objects tmp
GuiWidgets config.php index.php public zones
classes guiplugins mail templates
Open the file "config.php". Look for a line that begins with:
define('zoop_dir','/usr/local/zoop')
Change this line to make sure that the second argument of this define statement is the same as the location you installed zoop. Save the file and exit.
Open the file "zones/default.php". Look for a method named "pageDefault" inside. Edit this method so that it reads:
function pageDefault($inPath) {
echo("Hello world!");
}
Now we're ready to make our first request to our new zoop application. Within a web browser, go to:
http://yourhost.com/path/to/hello/
You should see the output "Hello world!"
Let's make our little app slightly more personalized. Open the file "zones/default.php" again. After the "pageDefault" method, create a new method:
function pageByName($inPath) {
$name = isset($inPath[1]) && !empty($inPath[1]) ? $inPath[1] : 'no name';
echo("Hello $name!");
}
Now check the results within your web browser by going to:
http://yourhost.com/path/to/hello/index.php/ByName/YourName
You should see the output "Hello YourName!"