Favourite Kohana Tips & Features?

kohana, kohana-3, kohana-3.3, kohana-orm, php

Solution

Generating Form::select() options from database result

Kohana 3.1 and 3.0

$options = ORM::factory('model')
 ->order_by('title','ASC')
 ->find_all()
 ->as_array('id','title');

$select = Form::select('name', $options);

It should be noted this is not restricted to the ORM and can be used on all database results (they all support as_array). See the database results information for more details.

If you want to add a default option:

$options = Arr::merge(array('Please select a value.'), $options);

Problem

Inspired from the other community wikis, I'm interested in hearing about the lesser known Kohana tips, tricks and features. - Please, include only one tip per answer. - Add Kohana versions if necessary. This is a community wiki.

Original source