Create a new app

This tutorial will walk you through the process of creating a new application for ZOO. We will create a Hello world application.

Getting started

All applications, existing and future, are located in /media/zoo/applications/APPLICATION. Have a look at existing applications to get a feeling for the folder structure of an application.

The base directory will contain 3-4 files. Two of them are the image files of the app icon.

If you create a new app you should create a new icon for it. You are not allowed to use the app icons of the pre-installed YOOtheme apps for your own, newly created app. See this tutorial on how to change the app icon.

Furthermore we have the application.xml that contains the applications metadata, configuration- and content parameters. And last but not least, there is the application.php. That file inherits from the Application class and controlls an applications custom workflow.

Next to the files there several folders in the applications base directory.

The config folder contains configuration files. If your application is supposed to use the comments system, you'll have to include the comments.xml here. If your application needs other alpha index options, you can modify the alpha_index.xml here.

The elements folder contains custom elements. Click here for a tutorial on how to build a custom element.

The language folder contains application specific language files.

The templates folder contains the applications templates. Click here for a tutorial on how to build a custom template.

The types folder contains the configuration for the applications types. Click here for a tutorial on how to build your own type.

Getting into detail

We will create a folder called /media/zoo/applications/helloworld/

We then add the application.xml file. It should contain an xml structure something like this:

<?xml version="1.0" encoding="utf-8"?>
<application>
	<name>Hello World!</name>

	<group>helloworld</group>
	<version>2.0.0</version>
	<creationDate>April 2010</creationDate>
	<author>John Doe</author>

	<authorEmail>john @ doe.com</authorEmail>
	<authorUrl>www.johndoe.com</authorUrl>
	<copyright>YOUR COPYRIGHT DISCLAIMER</copyright>
	<license></license>

	<description>This is our hello world app!</description>
	<params group="application-config">
	</params>
	<params group="category-config">
	</params>

	<params group="item-config">
	</params>
	<params group="application-content">
	</params>
	<params group="category-content">

	</params>
	<params group="item-content">
	</params>
</application>

As stated above, this file contains the applications metadata and parameters. For an explanation of the parameters click here. The metadata should be self-explanatory. The group tag is important, it needs to be the name of the applications folder.

The next step will be to add an application.php file. Our Hello World application will have no extra workflow and therefore the file will contain an empty class.

	class HelloworldApplication extends Application {}

The class name will consist of the applications group concatinated by the word Application.

Our Hello World application will need an icon, we therefore will design an icon and call the file application.png. Click here for a tutorial on how to change the app icon.

The only thing left to do, is to create our own templates. Click here for a tutorial on how to build a custom template.

Conclusion

This tutorial walked you through the process of creating your own application. If your application needs a special workflow. Have a look at the Application base class. It contains the default behavior. As always, get inspired through the existing applications.

Documentation on Github

Help us out! If you are feeling that our documentation has errors or can be improved, fork it at Github and send us a pull request. Any contribution is much appreciated. Thank you!