Just wondering: In yii, some of the class fields are named as
public $_files; public $_name; Others without underlining
public $db; What is the difference?
Fields marked with underscore are metadata?
Usually, underlined variables start protected variables. It is customary to write a setter and a getter to these variables, since out of no access to them.
Example:
protected $_name; public function getName() { return $this->_name; } public function setName($name) { $this->_name = $name; return $this; } return #this; , and return $this; :-) - JohnySource: https://ru.stackoverflow.com/questions/282691/
All Articles