Set value for amountToRelad var so it can be accessed on any method on the class
问题 I'm working in a OctoberCMS component and have some problems getting things working. Take a look at this code: class Payment extends ComponentBase { /** * This hold the amount with PayPal fee and discount applied and pass back to template * @var float */ public $amountToReload; public function onAmountChange() { $amount = post('amount'); if (empty($amount)) { throw new \Exception(sprintf('Por favor introduzca un valor.')); } $this->amountToReload = round($amount - ($amount * (float) Settings: