This is documentation for Kohana v2.3.x.

Table of Contents
Statuscurrent page status
Todowhat needs to be done next

Sample Main Heading

Introduce the topic, provide general overview of usage and any relevant info.

For the API documentation:

if applicable List any relevant links to information Kohana Forum

Configuration

Describe how to configure, if applicable. Describe the config items, what they do, how to use them.

Example from Cache Library:

$config['driver'] = 'file';
 
$config['params'] = APPPATH . 'cache';
 
$config['lifetime'] = 1800;
 
$config['requests'] = 1000;

Drivers

config['driver'] sets the driver, which is the container for your cached files. There are 6 different drivers:

Driver parameters

$config['params'] contains driver specific parameters. (in above example - path to server writable cache dir)

Cache Lifetime

$config['lifetime'] sets the lifetime of the cache. Specific lifetime can be set when creating a new cache. 0 means it will never be deleted automatically

Garbage Collector

$config['requests'] average number of requests before automatic garbage collection begins. Set to a negative number will disable automatic garbage collection

How to get/instantiate the object

 $this->cache= new Cache;

How is the thing used

Explain usage here. (sample from Cache library)

Give a code example:

$this->cache= new Cache;
 
$table = $this->cache->get('table');
 
if ( ! $table) {
    $table = build_table();
    $this->cache->set('table', $table, array('mytag1', 'mytag2'), 3600);
}
 
echo $table;

Explain in detail:

There are 3 main steps:

Methods

List all the public methods (example from Cache library)

Use a descriptive name for the main heading, followed by the method name as sub heading.

Setting caches

set

set($id,$data,$tags = NULL, $lifetime = NULL) is used to set caches.

$data=array('Jean Paul Sartre', 'Albert Camus', 'Simone de Beauvoir');
 
$tags=array('existentialism','philosophy','french');
$this->cache->set('existentialists',$data,$tags);

Finding and getting caches

get

get($id) retrieves a cache with the given $id, returns the data or NULL

find

find($tag) supply with a string, retrieves all caches with the given tag.

Add all other methods methods here.

Database Table Schema

if applicable

If a database is required, list the schema here.

CREATE TABLE caches(
	id varchar(127),
	hash char(40),
	tags varchar(255),
	expiration int,
	cache blob);

Full coded example

If applicable, list a full code example here. Or provide links to online examples as well.