Skip to content

Instantly share code, notes, and snippets.

View NaszvadiG's full-sized avatar

Naszvadi Gábor NaszvadiG

View GitHub Profile
@devyfriend
devyfriend / MY_Router.php
Created January 11, 2013 13:55
Codeigniter DB Router for Modular
<?php (defined('BASEPATH')) OR exit('No direct script access allowed');
/* load the MX_Router class */
require APPPATH."third_party/MX/Router.php";
class MY_Router extends MX_Router {
function _set_routing()
{
// Are query strings enabled in the config file? Normally CI doesn't utilize query strings
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Jonahlyn subscriptions in Google Reader</title>
</head>
<body>
<outline text="Bokardo" title="Bokardo" type="rss"
xmlUrl="http://bokardo.com/feed/" htmlUrl="http://bokardo.com"/>
<outline
text="Computer Science 169, 001|Spring 2012|UC Berkeley"
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Article extends MY_Controller {
public function author($author = null,$offset = 0)
{
if($author == null){
show_404("Author not found !");
return true;
}
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class ArticleModel extends CI_Model {
function __construct()
{
parent::__construct();
}
function insert($author,$title,$content){
$this->db->insert("article",
@Relequestual
Relequestual / blog_model.php
Created February 19, 2012 22:33
CodeIgniter blog_model pisyek tut
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Blog_model extends CI_Model {
function __construct() {
parent::__construct();
//var_dump(get_instance()); exit;
// $CI = get_instance();
// $CI->load->database();
@gautamk
gautamk / auth.php
Created February 4, 2012 15:10
CodeIgniter Authentication Library , application/libraries/auth.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Auth {
/**
* @author K.Gautam
* @version 0.1
* @todo ability to add configuration.
*/
protected $CI=NULL;
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Model extends CI_Model {
/** Set this to the table name that the model is mapped to */
protected $tableName;
/** Set this to the primary key of the table for this model.*/
protected $primaryKey;
function __construct() {
parent::__construct();
@jonatanfroes
jonatanfroes / MY_Paginations.php
Created January 18, 2012 16:29
Extend CodeIgniter Pagination to add Query String
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* MY_Pagination Class
*
* Extends Pagination library
*
*/
class MY_Pagination extends CI_Pagination {
public $add_query_string = FALSE;
@arjaneising
arjaneising / route_url_helper.php
Created January 7, 2012 14:58
Routed URL helper for CodeIgniter
<?php
function route_url($segments, $slash = true) {
$CI =& get_instance();
$routes = $CI->router->routes;
$toReturn = false;
foreach ($routes as $route => $arch) {
@apcomplete
apcomplete / Session.php
Created November 28, 2011 20:12
Native session library for CodeIgniter
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter Native Session Library
*
* @package Session
* @subpackage Libraries
* @category Session
* @author Topic Deisgn
*/