Skip to content

Instantly share code, notes, and snippets.

@Menencia
Menencia / Kohana.sublime-completions
Created November 23, 2012 11:03
Kohana completions for Sublime Text 2
{
"scope": "source.php - variable.other.php",
"completions":
[
{ "trigger": "HTML::anchor", "contents": "HTML::anchor(${1:uri}, ${2:title = NULL}, ${3:attributes = NULL}, ${4:protocol = NULL})" },
{ "trigger": "HTML::attributes", "contents": "HTML::attributes(${1:attributes = NULL})" },
{ "trigger": "HTML::chars", "contents": "HTML::chars(${1:value = NULL}, ${2:double_encode = TRUE})" },
{ "trigger": "HTML::email", "contents": "HTML::email(${1:email})" },
{ "trigger": "HTML::entities", "contents": "HTML::entities(${1:value}, ${2:double_encode = TRUE})" },
<?php
Route::set('project_add', 'project/add/<section>',
array(
'section' => '(link)',
))
->defaults(array(
'controller' => 'project',
'action' => 'add_{$section}',
));
<?php
// Data to send
$res = array('success' => TRUE);
// Disable auto_render
$this->auto_render = FALSE;
// Return JSON
$this->response
<?php
// ORM request
$v = ORM::factory('user')->where('activated', '=', 1);
// Checks the number of results
$x = clone $v;
var_dump($x->count_all());
// Operations that would change the number of results