Introduction to the skeleton application.
Also available for download from the Zoop site (or SourceForge) is the Zoop Skeleton. This is a barebones application provided so that a programmer could have a starting point when beginning a new application. A new skeleton would likely be released with each new Zoop release so it is usually a good idea to get the skeleton that corresponds with your Zoop release.
The skeleton contains a number of files and directories of which some files are worth mentioning here * READ: THESE ARE IMPORTANT *.
config.php includes.php templates/default config/
We will look at a few of these files and directories individually to ensure our application turns out as well as it should.
config.php
This is your primary configuration file for your application. It contains a lot of defines to setup the options Zoop will use for your application. Mostly the defaults will work for you until you know enough to change them.
There is one setting however that will prevent your entire application from working until it is set properly. This is the location of Zoop on your system. It looks like this:
define('zoop_dir', '/home/steve/Projects/zoop');
That is where Zoop exists on my system and would be very unlikely in the same place on yours. Please change this to the appropriate location. Another important one is the app_status definition. Though we won't use it for the hello world application, it is one to make a note of. It can be dev, test or live and Zoop will handle things like errors and caching differently depending on the app_status.
includes.php
The next most important file is the includes.php file. A lot of things won't work if this file isn't used properly, luckily it is really easy to use. There are five sections of this file, configuration, zones, objects, misc, and pear.
Configuration
This section includes files like config.php and zoop.php. After that it sets up the zoop object which will be used for the rest of the file. The first thing we do after we have the Zoop object is use it to include the different components of zoop that our application will use. By only including the parts we use we help to eliminate application bloat a problem that many frameworks suffer from (most think of it as a necessary evil). Zoop based application can actually run really lean by simply only including the components you plan on using. For our hello world application we will only include the gui component. This is done with the function call:
$zoop->addComponent('gui');
Make sure all other addComponent calls are commented out and this call for gui isn't.
Zone
This section includes all the zones that we will be using in our application. *This is important* When you create a new zone don't forget to include it here. This is done with the function call:
$zoop->addZone('zonename');
For our hello world application we will only be using the default zone so make sure that only that line is uncommented.
Objects
This section is used to include objects. Objects are libraries that you use for your application. These could be objects (classes) or static functions (though it is usually a good idea to classify everything to avoid collisions in the global namespace). A good example of this would be if you were to write a webmail application you would want to create an object containing some IMAP or POP functions that could be used by your page functions. These objects are located in app_dir/objects and can exist in subdirectories. The are included with the function call:
$zoop->addObject('objectname');
Notice that we do not put the .php after the object name in the function call.
Misc
This section is up to you and is put here for organizational purposes. Just use standard php include or include_once here.
Pear
This section is for pear libraries that you need for your application. Zoop also uses pear for different things, but each component includes it's necessary pear libraries itself. It is always a good idea to use include_once when including pear libraries as you are not sure which pear libs Zoop will include (also using include_once) in the future. As a general rule Zoop only uses pear libraries when there is a compelling reason to do so. A good example of this is pear_DB an excellent database abstraction library which quickly surpassed the one we wrote in Zoop previously.
zone_default -> page_default { echo("hello world"); }
In a Zoop application, when a web browser visits the http://example.com/application_dir/
Zoop will always execute the same page function. pageDefault inside of zone_default.php. The skeleton actually already has a welcome page there setup so lets go there in our web browser and make sure that we see what we want to see (it should be a welcome screen of some sort). If you see an error message instead retrace your steps. One step that many people forget is to make sure that the web server can write to the app_dir/tmp directory. That is where the template caching files are located and Zoop will display an error message if it cannot create them.
If you are reading this it is safe to assume that you have come thus far unscathed. You are almost there with your first Zoop application.
Edit zone_default.php with your favorite PHP editor. If you don't have a favorite PHP editor allow me to recommend some that I have enjoyed using. On Linux or Mac I love Quanta Plus. On Windows notepad++ is pretty nice and so is PHP Designer 2006. Of course there is always vim for any os. So back to zone_default.php, edit it and find the function called pageDefault. It already has some content in it, but we don't need to use that content, so comment it out or delete it. We should be left with a pageDefault function looking like this:
pageDefault($inPath) { }
Now lets place something into that function. Since this is a "hello world" app, we obviously want to echo ("hello world");. Your pageDefault should look like:
pageDefault($inPath) { echo("Hello World"); }
Now to view your application. In your web browser go to http://example.com/app_dir/
hi
Skeleton applications are useful.it's much help of all users.thanks for sharing about it..
home for sale Los Angeles
Thanks for the healthy
Thanks for the healthy tutorial and tips. It was a great review. I am looking forward to study more in your site. Book beach villas from my travel guide and choose your vacation in France with your beloved.
craigslist madison
these applications are so good and helpful.i like your post you do good effort to make it more valuable.
thanks for sharing.craigslist madison
Which part of the coding was
Which part of the coding was the most challenging to createspeedo aquabeat in your opinion?
good new, have been wating
good new, have been wating long for this release..
interested in muscle building and dont know how build muscles quick let me help you in the matter and you'll be surprised by the results.
I have read your Wayback
I have read your Wayback Machine and after that i have checked my includes.php and made sure the 'forms' component is enabled. Thanks for this information and i really have made few points clear because of this.
simplyforties.com
The next most important file
The next most important file is the includes.php file. A lot of things won't work if this file isn't used properly, luckily it is really easy to use. There are five sections of this file, configuration, zones, objects, misc, and pear.
tom ford sunglasses
This is a complete little
This is a complete little application; it doesn't do much, but it demonstrate how to create a number of pages sharing a common layout, and demonstrates some simple navigation. Thanks for sharing this post.
homework help
The skeleton directory
The skeleton directory structure has certain directories that must be in any Fusebox 5+ application and cannot be renamed. But its really good to use.
Hanging Basket
Its really good application.
Its really good application. I am sure it will be helpful to all who is looking for the same. Thanks for sharing this post.
look up cell phone numbers
I just couldnt leave your
I just couldnt leave your website before saying that I really enjoyed the quality information you offer to your visitors.criminal lawyers Ottawa Will be back often to check up on new stuff you post.lawyers Ottawa
I am not fascinated by the
I am not fascinated by the title Downloading music of such proprietor, nor is confused by the comfortable of the post.Download music online I do not rob the sofa, nor is it to soy mush.
It’s good
Well this category of in sequence is really appeal pointed for valentine wishes words, good in sequence for person who reads funny valentine message and a value for you as will certainly show the value of the valentine status writer. It’s good to have these kinds of articles around to keep the information flow steady.
The zope component
The zope component appearance design CMF is happy birthday messages a cell of free software series for Zope that forms a foodstuffs implementing loads of the key services a content regulation love text messages design would need.
A hello stain program
A hello stain program has become the traditional first program that many flights learn. In general exams tweets it is commoner enough that people who have no experience with computer programming can easily understand it, especially with the air of a engagement tweets teacher or a written guide.
Its like you learn my mind!
Its like you learn my mind! You seem to know so much about this, like you wrote the book in it or Kill Bill Sword something. I feel that you just can do with some percent to force the message house a bit, however other than that, that is magnificent blog.
Military Swords