EllisLab text mark
Advanced Search
     
$this->uri->uri_to_assoc(3, $default); strange behavior
Posted: 31 October 2007 06:59 PM   [ Ignore ]
Joined: 2007-04-18
40 posts

example:

controller:

class Some_class extends Controller {

    
var $data = array();
    function 
Some_class()
    
{
        parent
::Controller();
        
        
$this->load->database();
        
$this->load->model('my_model');
        
$this->my_model->some_function();
    
}
    
    
function index()
    
{
        $default 
= array('var1','var2');
        
$array $this->uri->uri_to_assoc(3$default);
        
print_r ($array);
    
}

model:

class My_model extends Model {

    
function some_function()
    
{
        $default 
= array('var3');
        
$array $this->uri->uri_to_assoc(3$default);
        
print_r ($array);
    
}

Now, when controller is executed, first uri_to_assoc will execute and set false to var3 if var3 is not found inside uri segment, but second execution, inside index function will not set var1 and var2 to false if they are not found inside uri segment. Now, i don’t know how to solve this problem and it is crucial for my current project, i am stuck and behind deadline. Any help?