GET parameters can be handled via function params instead of retrieving from the URI simplifying code.
This commit is contained in:
parent
451b24ca02
commit
5841670adb
2 changed files with 3 additions and 9 deletions
|
@ -1,16 +1,11 @@
|
|||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Gallery extends CI_Controller {
|
||||
public function index() {
|
||||
public function index($start = 1) {
|
||||
$this->load->model('fileupload');
|
||||
$this->load->library('pagination');
|
||||
|
||||
$page_count = 20;
|
||||
$start = $this->uri->segment($this->uri->total_segments(), 1);
|
||||
|
||||
if($start == 'index') $start = 1;
|
||||
|
||||
|
||||
$page_count = 20;
|
||||
|
||||
$config = array(
|
||||
'base_url' => base_url('/gallery/index/'),
|
||||
|
|
|
@ -12,10 +12,9 @@ class View extends CI_Controller {
|
|||
|
||||
}
|
||||
|
||||
public function specific() {
|
||||
public function specific($id = 'latest') {
|
||||
$this->load->model('fileupload');
|
||||
|
||||
$id = $this->uri->segment($this->uri->total_segments());
|
||||
$total_uploads = $this->fileupload->count_uploads();
|
||||
|
||||
if($id == 'latest') {
|
||||
|
|
Loading…
Reference in a new issue