Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
Validation doesn't work. $validator->run() always returns FALSE
vLight
February 2014
Hello. I try to validate a serach-query, but $validator->run() always returns FALSE, even though the passed input-data was valid.
#search-form (HTML)
http://pastebin.com/n4s1Euf3
#somewhere_in_search_controller
http://pastebin.com/veh0RG9k
I also tried the Form::open(), Form::close() methods... — same results
:(
#search-form (Form-Class)
http://pastebin.com/Zvu1DekT
Do I miss/forgot something obvious ?!
Harro
February 2014
Accepted Answer
Your search form is a HTTP GET, not a POST.
By default, run() processed posted data. There isn't any here, so it returns false. So either change your form to POST, or use
if ($validation->run(\Input::get()))
{
...
}
to explicity validate GET data.
vLight
February 2014
Thx, Harro
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
February 2014
vLight
February 2014