Skip to content

Instantly share code, notes, and snippets.

View jrvaja's full-sized avatar

Jaimin Vaja jrvaja

  • Adjust GmbH
  • Berlin, Germany
View GitHub Profile
@jrvaja
jrvaja / Controller_ActiveRecord1
Created June 27, 2012 07:07
CodeIgniter: Controller_ActiveRecord1
class Site extends CI_Controller {
//Shows data inserted and views
public function index()
{
if($query=$this->site_model->get_records()){
$data['records']=$query;
}
$this->load->view('option_view',$data);
}
@jrvaja
jrvaja / AutoLoadFile
Created June 27, 2012 07:08
CodeIgniter:AutoLoadFile
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| AUTO-LOADER
| -------------------------------------------------------------------
| This file specifies which systems should be loaded by default.
|
| In order to keep the framework as light-weight as possible only the
| absolute minimal resources are loaded by default. For example,
| the database is not connected to automatically since no assumption
@jrvaja
jrvaja / configurationFile
Created June 27, 2012 07:09
CodeIgniter:configurationFile
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
@jrvaja
jrvaja / htAccessFile
Created June 27, 2012 07:10
CodeIgniter:htAccessFile
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
@jrvaja
jrvaja / Css-Link
Created June 29, 2012 13:36
CodeIgnietr: Css-Link
@jrvaja
jrvaja / PaginationView-phpCode (1)
Created June 29, 2012 13:38
CodeIgniter: PaginationView-phpCode
<?php echo $this->table->generate($records); ?>
@jrvaja
jrvaja / TableHeadingChanger
Created June 29, 2012 13:41
CodeIgniter: TableHeadingChanger
$this->table->set_heading('Id','My Title','My Content');
@jrvaja
jrvaja / DB_QUERY
Created July 2, 2012 17:24
CodeIgniter: DB_Query
/*************************************************************************
Query With Multiple Results
**************************************************************************/
/*--------------------------------------------------------------*/
Obejct Version
/*--------------------------------------------------------------*/
$query = $this->db->query('SELECT name, title, email FROM my_table');
foreach ($query->result() as $row)
{
@jrvaja
jrvaja / view_functions
Created July 2, 2012 17:57
CodeIgniter: view_functions
<!-- ************************************************************************** -->
<!-- Load multiple Views -->
<!-- ************************************************************************** -->
<?php
class Page extends CI_Controller {
function index()
{
$data['page_title'] = 'Your title';
@jrvaja
jrvaja / ci_Items
Created July 3, 2012 03:52
CodeIgniter:Items
/*************************************************************************
Loading a Config File
**************************************************************************/
/*----------------------------------
Manual Loading
----------------------------------*/
$this->config->load('filename');
/*************************************************************************
Fetching Config Items
**************************************************************************/