This is documentation for Kohana v2.3.x.
Status | Draft |
---|---|
Todo | Pretty much everything |
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
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.
Status | Draft |
---|---|
Todo | Complete 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.
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.
<box red> This method only exists in version x.x </box>
Gives:
This method only exists in version x.x
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.
All code examples should follow the Kohana coding standards found at http://dev.kohanaphp.com/wiki/kohana2/CodingStyle
Files and directory paths should be styled as follows:
application/config/config.php
Note: there is no leading slash.
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
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
$arg1
The name of the field for XYZ
$arg2
An optional array of attributes.$arg3
The value of ABC
, default is description of defaultXYZ
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');
get($key = FALSE, $default = FALSE)
retrieves a named value from the session data.
$key
specifies the name of the data to retrieve from the session. $default
specifies a default value to be returned if the named data does not exist in the session.$key
If $key
is FALSE
, get()
returns an array containing all of the data in the current session.Code Example:
$item_name = $this->session->get('item_name');
An example of how a page should be structured Page layout sample