Hi.
I am new to Agavi. Bear with me if I enquire about the obvious.
I was wondering whether the usual separation of views into "Input",
"Success", "Error" etc. is just a convention, or if there's a functional
purpose to it. I mean, is it a serious offense to mix some of these views
into one, especially when there's very little code in either of them?
Case in point, the sample application that comes with Agavi has three views
for the Login action: Input, Error, and Success. Now, the Error view is only
there to set an error on the validation manager, after which it renders the
template for the Input view. Here's the meat of it:
if(($error = $this->getAttribute('error')) !== null) {
> $this->container->getValidationManager()->setError($error,
> $this->context->getTranslationManager()->_('Wrong ' . ucfirst($error),
> 'default.errors.Login'));
> }
>
What if I simply add this code to the Input view, and have the action return
"Input" instead of "Error" when the wrong credentials have been entered? Am
I headed for trouble?
Thanks,
George
_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users