In the following code, variables user and permissions are not declared at the beginning like $data, $module etc. And these $this->user and $this->permissions are used in the extended class of this class.
My question is can I use variables without declaring and using $this->myvar?
Thanks in advance.
class MY_Controller extends CI_Controller {
// Deprecated: No longer used globally
protected $data;
public $module;
public $controller;
public $method;
public function MY_Controller()
{
.......
$this->user = $this->ion_auth->get_user();
.........
// List available module permissions for this user
$this->permissions = $this->user ?
$this->permission_m->get_group($this->user->group_id) : array();