Skip to content

Instantly share code, notes, and snippets.

@jbottigliero
Created June 5, 2012 16:37
Show Gist options
  • Save jbottigliero/2876127 to your computer and use it in GitHub Desktop.
Save jbottigliero/2876127 to your computer and use it in GitHub Desktop.
CodeIgniter URI Library: Add offset functionality to the `uri_string` method.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
// ------------------------------------------------------------------------
/**
* MY_URI Class
*
* Parses URIs and determines routing
*
* @package CodeIgniter
* @subpackage Libraries
* @category URI
* @author ExpressionEngine Dev Team
* @link http://codeigniter.com/user_guide/libraries/uri.html
*/
class MY_URI extends CI_URI {
/**
* Fetch the entire, or a portion of the URI string
*
* @access public
* @param integer the starting segment number
* @return string
*/
function uri_string($n = FALSE)
{
if($n === FALSE)
{
return $this->uri_string;
}
return $this->assoc_to_uri( $this->uri_to_assoc( $n ) );
}
}
// END URI Class
/* End of file MY_URI.php */
/* Location: ./application/core/MY_URI.php */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment