Passing data between states PHP
Posted
by esryl
on Stack Overflow
See other posts from Stack Overflow
or by esryl
Published on 2010-05-03T13:55:41Z
Indexed on
2010/05/03
14:18 UTC
Read the original article
Hit count: 357
So I am using Limonade PHP which has a RESTful design which emulates PUT, POST, DELETE routes for create, update, delete.
I am trying to develop some form validation which is going well. The major problem I am facing though is how to return my filtered data (which has failed validation) back to repopulate the create or edit form.
How would this be done? I currently have for creating a page:
/admin/page/new -> GET function
/admin/page -> POST function
+ validate
+ pass, update db
+ fail, add errors to flash, redirect to /admin/page/mew
It all falls down as I do not know how to populate the /admin/page/new with the invalid, but filtered data.
© Stack Overflow or respective owner