What is the advice on use of Toenails to secure a shower base (or tub) lip/flange to the wall studs?

Is this ever really recommended......or having the shower pan secured in a bed of mortor....or just having a heavy cast iron tub sit on the floor......good enough?

Dan