Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Overriding Get Method

$
0
0
Hi all, I know this is the first of january but i'm trying to finish something.
It's quite simple (or have to be ><) : I want to everride a getter method.
I've got an object with a field and I want to change the value befeore returning it
Apparently I just have to create the field in protected and create the getter method but it doesn't work

It always send me an empty string...

Here is my code. I've put only $this->name but even with that it doesn't work
protected $name;
public function getName() { 
	return $this->name;
}

What have I missed ?
Thanks

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>