Skip to content

Instantly share code, notes, and snippets.

@yaranaio
yaranaio / gist:2049302
Created March 16, 2012 09:39
twitter bootstrap alert helper
<?php
if (!function_exists('alert')) {
function alert($message) {
$buffer = null;
if ( !empty($message) ) {
$buffer .= '<div class="alert ';
if ( array_key_exists('alert-error', $message) ) {
$buffer .= 'alert-error">';
if ( is_array($message['alert-error']) ) {
$buffer .= '<ul>';
@yaranaio
yaranaio / upload.php
Created March 16, 2012 07:37
CodeIgniter config file upload.php
<?php
$config['upload_path'] = '';
$config['allowed_types'] = 'gif|jpg|png';
$config['file_name'] = '';
$config['overwrite'] = false;
$config['max_size'] = 2048; // 2M
$config['max_width'] = 0;
$config['max_height'] = 0;
$config['max_filename'] = 0;
$config['encrypt_name'] = false;
@yaranaio
yaranaio / pagination.php
Created March 15, 2012 06:41
Twitter bootstrap was applied to the CodeIgniter Pagination
<?php
$config['first_link'] = false;
$config['next_link'] = '次へ >>';
$config['prev_link'] = '<< 前へ';
$config['last_link'] = false;
$config['full_tag_open'] = '<div class="pagination"><ul>';
$config['full_tag_close'] = '</ul></div>';
$config['first_tag_open'] = '<li>';
$config['first_tag_close'] = '</li>;';