<<-package.xml->>package.xml is the main configuration file for a package. this file tells zephyr which actions to run first, what are the dependencies and which actions should runs everytime before executing another action. here is a complete package.xml file that runs with zephyr beta2. <?xml version="1.0" encoding="iso-8859-1"?>
<<-package definition reference->><name>my_package_name</name> <name> is the title of your package. zephyr renders this setting and set as title for every page. this definition has no other effect. <version>package_version</version> version is the version number of your package. zephyr set it in title bar beside your package name. so if you package name is "sample package" and version is "2.00" then you will see "sample package version 2.00" in title bar everytime you run your package. <root_template>std.tpl</root_template> this is the template which zephyr runs when some one request your package without specifying any action explicitely. that means this template will be considered as your home page. but this definition is deprecated from zephyr preview release 2.00. we strongly suggest to use <root_action> instead of <root_template> <root_action>home</root_action> this the action which runs first time when your package is requested without specifying any action. these actions must reside in "packages/your_package/actions" folder. <javascript>std</javascript> this is the javascript file name to include in your rendered template everytime. dont use any extension with this name. keep this javascript files inside "javascript" folder in your package. you can use as many javascript you want to include. In zephyr version prior than Beta2, only one javascript file is supported. In Beta2, you can include as many as you want. <css>std</css> this is the css file to include in your rendered templates. dont use any extension with this file name. you have to place this css file inside "styles" folder inside your package folder. zephyr currently supports only one css file at a time. <php>std</php> these are the user made php files to include. these files are extremely when you made some custom functions and want to use them inyou action files. when you specify these php files with <php> tag, zephyr includes them at the initial stage and all functions inside these filse are available to your actions. Prior that Beta2, you can include only one php file. But from Beta2, you can include as many php files as you want. these php files must be placed under "php" folder inside your package folder. <pre_action_processor>preaction</pre_action_processor> pre_action_processor defines some action which will be run everytime before executing a normal action. this is extremely helpful if you want to run some valication, check session variable or check privilege before executing another action. pre processo actions and normal action, just you have to place them in "helper" folder inside package folder. zephyr invokes its execute() method. if execute() returns true, normal action will run. other wise zephyr stops at that time and displays error_message of this pre action processor. following is a typical preaction processor. <?
//preaction.class.php [place inside helper folder inside your package]
class preaction implements action
{
public $error_message;
public function execute()
{
//process validations
//if validation fails
from Beta2 of zephyr, you can run as many pre_action_processors as you want. |
|