I have little issue with some messy code, i think it can be better, i use pagination class for displaying the pages, only problem i have is that i want to style it different? Now i have in my controller some functions?
public function products
{
$config["per_page"] = 4;
$config["uri_segment"] = 2;
$config['cur_tag_open'] = '<li><span class="page active">';
$config['cur_tag_close'] = '</span></li>';
$config['num_tag_open'] = '<li class="page gradient">';
$config['num_tag_close'] = '</li>';
$config['prev_link'] = '< prev';
$config['prev_tag_open'] = ' <li class="page gradient">';
$config['prev_tag_close'] = '</li>';
$config['next_link'] = 'next >';
$config['next_tag_open'] = '<li class="page gradient">';
$config['next_tag_close'] = '</li>'
}
And other again the same
public function milks
{
$config["per_page"] = 4;
$config["uri_segment"] = 2;
$config['cur_tag_open'] = '<li><span class="page active">';
$config['cur_tag_close'] = '</span></li>';
$config['num_tag_open'] = '<li class="page gradient">';
$config['num_tag_close'] = '</li>';
$config['prev_link'] = '< prev';
$config['prev_tag_open'] = ' <li class="page gradient">';
$config['prev_tag_close'] = '</li>';
$config['next_link'] = 'next >';
$config['next_tag_open'] = '<li class="page gradient">';
$config['next_tag_close'] = '</li>'
}
You see there are the same? But i use it twice and every time i have pagination i must put config in that function, is it possible to style it in global way like
function __construct()
{
$config["per_page"] = 4;
$config["uri_segment"] = 2;
$config['cur_tag_open'] = '<li><span class="page active">';
$config['cur_tag_close'] = '</span></li>';
$config['num_tag_open'] = '<li class="page gradient">';
$config['num_tag_close'] = '</li>';
$config['prev_link'] = '< prev';
$config['prev_tag_open'] = ' <li class="page gradient">';
$config['prev_tag_close'] = '</li>';
$config['next_link'] = 'next >';
$config['next_tag_open'] = '<li class="page gradient">';
$config['next_tag_close'] = '</li>';
}
That all other pagination that i use in my application use the same styling, and not to repeat it again function by function?
Regards