Skip to content

Instantly share code, notes, and snippets.

View panbanda's full-sized avatar

Jonathan Reyes panbanda

View GitHub Profile
@panbanda
panbanda / gist:2141902
Created March 20, 2012 22:22
Form Submission Handler for Base Controller
<?php
/**
* Check for form submission with a csrf check
*/
private function __form_submission()
{
if ($post = Input::post())
{
$token = Arr::get($post, 'csrf');
@panbanda
panbanda / gist:2024462
Created March 12, 2012 20:24
Kohana 3.x ORM Pagination
<?php
// Establish search query
$search = ORM::factory('blog');
// Get search total
$total = $search->reset(FALSE)->count_all();
// Create pagination
$pagination = Pagination::factory(array(