Skip to content

Instantly share code, notes, and snippets.

View ryross's full-sized avatar

Ryder Ross ryross

View GitHub Profile
@ryross
ryross / index.php
Created August 5, 2010 05:02
views/main/main.php
<?php echo View::factory('template/header'); ?>
<div class="content main">
<h1>Main</h1>
</div>
<?php echo View::factory('template/footer'); ?>
@ryross
ryross / main.php
Created August 5, 2010 05:04
classes/controller/main.php
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Main extends Controller_Base
{
public function action_index()
{
$this->template->title = "Home";
$this->template->content = View::factory('main/index');
}
@ryross
ryross / bootstrap.php
Created August 5, 2010 05:09
bootstrap.php
<?php defined('SYSPATH') or die('No direct script access.');
//-- Environment setup --------------------------------------------------------
/**
* Set the default time zone.
*
* @see http://kohanaframework.org/guide/using.configuration
* @see http://php.net/timezones
*/
@ryross
ryross / errors.php
Created August 5, 2010 05:12
classes/controller/errors.php
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Errors extends Controller_Base
{
public function action_404()
{
$this->template->title = "File Not Found - 404";
$this->template->content = View::factory('errors/404');
}
public function action_500()
@ryross
ryross / 404.php
Created August 5, 2010 05:14
views/errors/404.php
<?php echo View::factory('template/header'); ?>
<div class="content error">
<h1>File Not Found - 404</h1>
</div>
<?php echo View::factory('template/footer'); ?>
@ryross
ryross / 500.php
Created August 5, 2010 05:14
views/errors/500.php
<?php echo View::factory('template/header'); ?>
<div class="content error">
<h1>Application Error - 500</h1>
</div>
<?php echo View::factory('template/footer'); ?>
@ryross
ryross / header.php
Created August 5, 2010 05:19
views/template/header.php
<div id="header">
<h1><a href="/">Header</a></h1>
</div>
@ryross
ryross / footer.php
Created August 5, 2010 05:21
views/template/footer.php

Pagination Configuration

[Pagination] uses 6 settings: current_page, total_items, items_per_page, view, auto_hide and first_page_in_url.

Configuration Examples

This example shows the default configuration:

return array(
@ryross
ryross / .bashrc
Created October 30, 2010 00:27
bash prompt w/ git branch
## GIT PROMPT
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"