[eluser]egunay[/eluser]
Your welcome,
Using a model from library is a bit more difficult then using it in your view. I mean you have to get CI instance:
In your library:
Code:
<?php
class Loadimages {
function printimages($id, $urli) {
//Get Instance
$CI =& get_instance();
$CI->load->model('your_model');
//and from this point on instead of using "$this->" use $CI->
$thumb = glob("images/$id/{*.jpeg,*.jpg,*.png}", GLOB_BRACE);
$big_img = glob("images/$id/big_img/{*.jpeg,*.jpg,*.png}", GLOB_BRACE);
$main_img = glob("images/$id/main_img/{*.jpeg,*.jpg,*.png}", GLOB_BRACE);
if ($thumb != 0) {
echo "<table width='900'>";
$x = 0;
/*
....
...
..
.
*/
And if you want to make things still more MVC style,
In your controller
Code:
$this->load->library('loadimages');
$data['somename'] = $this->loadimages->printimages($this->uri->segment(3), base_url());
$this->load->view('your_view', $data) // Pay attention to $data here
In your view
Code:
<?php
echo $somename; //you are using the array's key name that you have created in your controller
?>
//to make things more minimalistic;
<?=$somename;?>