1
0
Fork 0

GET parameters can be handled via function params instead of retrieving from the URI simplifying code.

This commit is contained in:
Andrew Tomaka 2011-11-14 09:30:09 -05:00
parent 451b24ca02
commit 5841670adb
2 changed files with 3 additions and 9 deletions

View file

@ -1,16 +1,11 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Gallery extends CI_Controller { class Gallery extends CI_Controller {
public function index() { public function index($start = 1) {
$this->load->model('fileupload'); $this->load->model('fileupload');
$this->load->library('pagination'); $this->load->library('pagination');
$page_count = 20; $page_count = 20;
$start = $this->uri->segment($this->uri->total_segments(), 1);
if($start == 'index') $start = 1;
$config = array( $config = array(
'base_url' => base_url('/gallery/index/'), 'base_url' => base_url('/gallery/index/'),

View file

@ -12,10 +12,9 @@ class View extends CI_Controller {
} }
public function specific() { public function specific($id = 'latest') {
$this->load->model('fileupload'); $this->load->model('fileupload');
$id = $this->uri->segment($this->uri->total_segments());
$total_uploads = $this->fileupload->count_uploads(); $total_uploads = $this->fileupload->count_uploads();
if($id == 'latest') { if($id == 'latest') {