Added view method to capture template output in a variable.