我剛開始使用OOP/CodeIgniter。我想要將表單輸入分配給變量。我想知道哪一個我應該使用$this -> var
或$var
以及它們如何相互區別?謝謝。
例如
$agree = $this -> input -> post('agree');
OR
$this -> agree = $this -> input -> post('agree');
雙方將做工精細,如:
if ($agree) { }
OR
if ($this -> agree){ }
謝謝