Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Yii And Jquery : Beginner Question

$
0
0
I was just recently turned on to yii from a co-worker. The only MVC architecture I have worked with is one that my company had already developed. I have been reading about yii and it seems like the way to go. I have also watched a few videos and read some of the beginner tutorials.

With our MVC at work we use jquery for pretty much every button click. We will always include the code in the view like this:

<div id="listOfStuff"></div>
<div id="button">Click Me</div>

<script>
$('#button).click(function() {
$.ajax({
type: POST,
dataType: json,
url: '/functions/whatever.php',
success: function( returnData ) {
$('#listOfStuff').html( returnData );
}
});
});
</script>


From looking at the forum it seems like this may not be they way to do it with yii. What is the best way to go about doing somehting like this to take advantage of yii?

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>