Added view type getter and ensured element render events would get the proper type

Cake's coding standards need space around `=>`, also single quotes are preferred to double for literals.