[eluser]xwero[/eluser]
Echo is a bad practice to use in functions because it creates output on the spot. if you add a function that uses echo in your controller before you call the view the output of the echo will be above the view.
I really think you should learn the basics of programming before you start developing complex functions.