CakePHP how to create functions : How can I create functions that can be called in view(like in the index.ctp)?

I just wrote a function in one of my controllers but I'm getting this error message: "Error: Call to undefined function getWins()".

Basically I want this function to search my database table "Matches" and return the total count of a specific record. I know my function code is right but I don't know how to call it in the view.