Added comments to some controller functions and improved spacing to improve readibility of code (#120)

This commit is contained in:
FrancescoUK
2016-01-17 17:56:54 +00:00
parent d1a973564f
commit 9dcbef988a
8 changed files with 41 additions and 25 deletions

View File

@@ -1,7 +1,6 @@
<?php
class Secure_area extends CI_Controller
{
private $controller_name;
/*
@@ -37,13 +36,15 @@ class Secure_area extends CI_Controller
$this->load->vars($data);
}
function get_controller_name() {
function get_controller_name()
{
return strtolower($this->controller_name);
}
function _initialize_pagination($object, $lines_per_page, $limit_from = 0, $total_rows = -1, $function='index', $filter='')
{
$this->load->library('pagination');
$config['base_url'] = site_url($this->get_controller_name() . "/$function/" . $filter);
$config['total_rows'] = $total_rows > -1 ? $total_rows : call_user_func(array($object, 'get_total_rows'));
$config['per_page'] = $lines_per_page;
@@ -54,11 +55,12 @@ class Secure_area extends CI_Controller
$config['cur_page'] = $limit_from > 0 ? $limit_from : 0;
$config['page_query_string'] = FALSE;
$config['uri_segment'] = 0;
$this->pagination->initialize($config);
return $this->pagination->create_links();
}
function _remove_duplicate_cookies ()
{
//php < 5.3 doesn't have header remove so this function will fatal error otherwise