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

auzadventure
auzadventure

Hi I found

function onTest()
{
    $this->page['result'] = input('value1') + input('value2');
}

This did not seem to work. However this

function onTest()
{
    $this['result'] = input('value1') + input('value2');
}

Did.

Could you check and update the documentation if this is the case. A lot of beginners might get frustrated.

Last updated

pain-spark50564
pain-spark50564

The first one its component ajax to update a partial, i passed this problem too. The second its in page cms, put this code on " code window". To make the first one run you need put the right scripts on your layout, after you can paste this code on your conponent.php --> public function onTest() { $this->page['result'] = input('value1') + input('value2'); }

you must have thats scripts on you " assets/vendor" on you theme . jquery.js and boostrap.js

paste those codes on buttom of your layout

    <script src="{{ 'assets/vendor/bootstrap.js'|theme }}"></script>
    <script src="{{ 'assets/javascript/app.js'|theme }}"></script>

then you must put the component on you page and update you browse (chrome ex) and voilá

if you do right all those steps, this exemple code will run.

pain-spark50564
pain-spark50564

The first one its component ajax to update a partial, i passed this problem too. The second its in page cms, put this code on " code window". To make the first one run you need put the right scripts on your layout, after you can paste this code on your conponent.php --> public function onTest() { $this->page['result'] = input('value1') + input('value2'); }

you must have thats scripts on you " assets/vendor" on you theme . jquery.js and boostrap.js

paste those codes on buttom of your layout

    <script src="{{ 'assets/vendor/bootstrap.js'|theme }}"></script>
    <script src="{{ 'assets/javascript/app.js'|theme }}"></script>

then you must put the component on you page and update you browse (chrome ex) and voilá

if you do right all those steps, this exemple code will run.

1-3 of 3

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