accessing methods

What the function is doing exactly? I guess if it is related to an object, putting it in your model woud work. If it is not, then perhaps in the controller? Without knowing what does the function it's hard to get the logic that you should apply.