This is a sample view
cron actions are those action which executes at a regular interval. these actions are extremely usefull if you want to update a portion of your page automatically after a certain time. in zephyr, you can easily create such cron actions. to invoke an action as cron action use use run_cron_function() function, take a look at the following example.
<<how to extend core zephyr classes>>
Zephyr has a feature rich data access object class by which you can perform different data operations, optionally with help of a data domain model. To call MySQL aggregate functions like “avg”, “min”, “max” and so forth, you can access it like this
This process is easy enough and gives you the full control. But zephyr's main goal is to provide an easy convenient way to perform tasks. So how about if we extend our DAO class so that we can call these aggregator functions in an easy way
Save this class as “extendedDAO.class.php” in “php” folder under your package directory. To use this class you must load it using default PHP file loader feature for your package. In your package definition, add the following line.
Well, we are done. Now we can call any MySQL aggregator function with the help of it. For example lets have a look at following example.
This example is much easier and user friendly than the previous one. By the way, this is just an example how you can extend core Zephyr classes for better functionality. From Zephyr preview beta 1.00, DAO calss has this aggregator() function builtin.
<<-use package initializer->>
package initializers are special class which invoked only one time while initializing the package. you can use this package for initializing session for authentication or other preparatory tasks which you need to perform only once.
package initializer must be named as "initializer.class.php" and placed inside "helper" folder. lets take a look at sample package initializer.
<<-calling another action from an action->>
in zephyr actions you can easily invoke another action using load_action() function. lets take a look at the following example. you can pass arbitrary number of arguments to these functions. you can accept their return values. you must pass these parameters in a key value array
if you set third parameter to true, after executing this action, it will return the value to your calling procedure.