This is documentation for Kohana v2.3.x.

Table of Contents
StatusDraft
TodoPretty much everything

Guidelines

Anyone is free to create an account and start editing this user guide. These are the guidelines you should follow to keep it consistent and tidy. If you have ideas for these guidelines then please start a discussion. Documentation is always for the latest release, currently 2.3

Page Status

At the top of most pages you will find a status box. This should be kept up to date while you are editing the pages.

StatusDraft
TodoComplete this_function(), add example to that_function()

There are 5 different values status can be:

There is also an optional Todo line. Any information you think will be helpful to other documenters should be added here, such as functions to be completed or sections that are out of date. Once something is completed it should be removed.

Versions

The user guide should always be written for the release version of the framework. If there are changes made in the SVN version then these should be highlighted in the user guide using a box, e.g.

Code:

<box red>
This method only exists in version x.x
</box>

Gives:

This method only exists in version x.x

Plugins

There are a few extra plugins installed in this wiki for use in the user guide.

Boxes

These should be used to note something important. The default blue colour should be used for normal notes and red should be used when it's critical. Rounded corners should not be used.

Code2

Styling Conventions

Code examples

All code examples should follow the Kohana coding standards found at http://dev.kohanaphp.com/wiki/kohana2/CodingStyle

Files and Directories

Files and directory paths should be styled as follows: application/config/config.php Note: there is no leading slash.

Variable names

Variable names, files, class and method names used in the text should be styled as follows:

$variable is used by Kohana::log when writing to application/logs/log.php

Methods

The following style / layout should be used to document Methods:

Specify only the method name in descriptions. Code examples must provide the full notation, Class→method or Class::method

method($arg1, $arg2 = NULL, $arg3 = 'default_value') returns the number of items in XYZ given arg1

Code Example:

// Preferred notation using $this->
$this->class->method($arg1);
// OR, if the class can be accessed via an instance
Class::instance()->method($arg1)
// OR, for static methods and helpers
Kohana::log('type', 'message');

Example: Retrieve a session item

get($key = FALSE, $default = FALSE) retrieves a named value from the session data.

Code Example:

$item_name = $this->session->get('item_name');

Page layout

An example of how a page should be structured Page layout sample