Ajax and Model

Hi

I have a view with a button.

How can i use Ajax in this view

to call create function of my Model!

Thank you.

Are you asking how to call a method on the button to generate ajax code?

Yii2 is different than Yii 1.x in this regard. With Yii2 the ajax methods are gone, you just write your own JS file with your ajax call and register it to the .click event or whatever is suitable for your needs.

Hi Waitforit,

Many thanks for the help.

Yes, I need to find a solution to call a method on the button to generate ajax code.

I’m a web developer but i do not know very well YII1 and YII2.

Where can I get a sample source code for resolve this problem.

Sorry for my bad english.