This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

reynierpm
reynierpm

I have this component class:

class Payment extends ComponentBase
{
    protected $amountToReload;

    public function componentDetails()
    {
        return [
            'name' => 'Payment',
            'description' => 'Allow users to recharge their balance for international calls through Alomicuba'
        ];
    }

    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::get('ppal_fee') - (float) Settings::get('ppal_discount')), 2);
        Session::put('amountToReload', $this->amountToReload);
        return ['#amountToReload' => $this->amountToReload];
    }

    public function stepTwo() {
        echo "I am on step2 function";
    }

    public function stepThree()
    {
        echo "I am on step3 function";
    }
}

I access that component trough this URL http://project.dev/payment now I'm asking if it's possible to execute stepTwo by passing a parameter trough URL for example http://project.dev/payment/steptwo? How?

daftspunky
IchBin
IchBin

you managed to do? I fail to do

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.