Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14348

Multiple method calls from library

$
0
0
Hi there,

I would like to know how can I call two methods from library in a loop? For example I have library called "Test" and I load it in my controller
PHP Code:
$this->load->library('test'); 

I have array with values, for example:
PHP Code:
$values = array(1020304050); 

Now I have to loop through that array and call two methods from my library:
PHP Code:
foreach($values as $value) {
    
$this->test->set($value);
    
$returned_value $this->test->get();
    echo 
$returned_value.'<br>';


My problem is that after the first call of these methods I can see returned value but after that I'm not getting any remaining values. How can I achieve that in CodeIgniter?

Viewing all articles
Browse latest Browse all 14348

Trending Articles