2010年9月12日星期日

[fw-mvc] Validating ajax with Zend_Rest_Route?

Hi all,

first of all, hopefully my problem is not totally wrong here. I decided
to post it here as it seemed more appropriate than in fw-general.

My problem:
I use the MVC-stack and I decided to do validation via ajax and the
Zend_Form component, as Zend_Form supports this via processAjax().

However, I thought it would be a good idea to make the controllers that
are related to CRUD operations RESTful.

Said that, Zend_Rest_Route only supports 7 actions (new, edit, get, put,
post, delete, index).
But - where am I supposed to put the validation stuff? (Of course, the
validation itself won't be done by the controller but by the models.
The controller will only call the appropriate methods, e.g.
$form->processAjax(...)).

I mean, putting it - for example - into the PUT action seems somehow
unnatural to me? Or is this the way it should be? I'm actually missing
some kind of "validateAction" or something. However, it might be the
case that I got something severely wrong, so any hint and advise is
highly appreciated.

Thanks in advance
Christian

没有评论: