method call in mvc2
I am a fresher and new to mvc2.I have a method in my model class dat开发者_开发知识库 will display a pie chart in a view. Now i have to call this method inside the index method of the controller. Can anyone guide me how to do this?
I think that the method in the model should give information to view in order to create the chart.
So:
Controller:
get data for pie chart
pass it to the view (return view(model))
Model
function to get the data for the pie chart
View
display a pie chart with the data supplied by the controller.
精彩评论