Welcome Guest, Not a member yet? Register   Sign In
Variables in class problem
#3

[eluser]Michal1[/eluser]
Thank you, you are right I need to study OOP more. Just a thing. So I have made:

Code:
public $example;
    
    public function __construct() {
        
          parent::__construct();
    $this->example ='1';
  }

then i have a function detal where I want to pass its uri segment to that example variable.

So I have

function detail()

{

some code blabla

$this->example=$this->uri->segment(3);

}

But when I then echo this variable I always receive a 0 even the third segment in urls has always nubmers like 78 or 90 etc. What I o wronh?


Messages In This Thread
Variables in class problem - by El Forum - 02-17-2011, 04:51 AM
Variables in class problem - by El Forum - 02-17-2011, 05:10 AM
Variables in class problem - by El Forum - 02-17-2011, 05:39 AM
Variables in class problem - by El Forum - 02-17-2011, 05:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB