how to use view_paths() and why you need to use.

how to use view_paths() and why you need to use. What is the purpose. can you explain and give some sample code.