I'm developing web site on self made MVC engine.I have actionController that handles operations like register, login, post submit and etc. actionController receives operation name and parameters.Of course it mast handle errors such user with same nick already exists or password is to short about which action handler have to notify user. The question is which is the best way to organize errors, such that View could easily get localized user notification message.I see two waysFirst one:define error constants likeERR_NICK_BUSY = '1'ERR_NICK_INVALID = '2'...and localization maplocal[ERR_NICK_BUSY] = 'User with the same nick already registered'local[ERR_NICK_INVALID ] = 'Nick, you entered is invalid'...And second one:define abstract constants likeERR_FIELD_BUSY = '1'ERR_FIELD_INVALID = '2'...and pass them with field name. In this case localization looks likelocal['nick_'+ERR_FIELD_BUSY] = 'User with the same nick already registered'...I don't like both this methods. Can you advise something else?
How properly perform passing operation result to View
coding style;mvc