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
fieldset form with method GET
mspace
April 2012
Can I have fieldset with GET method not post. I tried this: $fieldset = Fieldset::forge(); $fieldset->form()->set_attribute('method', 'get');
$fieldset->form()->add('term', '', array('type' => 'text', 'value' => $fieldset->validation()->input('term')), array('rules' => array('required')))->add_rule('required')->add_rule('trim')->add_rule('min_length', 3)->add_rule('max_length', 32);
$fieldset->form()->add('submit', '', array('type' => 'submit', 'value' => 'Search')); // validation
//
if( $fieldset->validation()->run() === true )
{
.....
}
else
{
$this->template->view = View::forge('search', array(
'form' => $fieldset->build(),
'validation_error' => $fieldset->validation()->error('term')
), false );
}
Method run() has this: public function run($input = null, $allow_partial = false, $temp_callables = array())
{
if (empty($input) && \Input::method() != 'POST')
{
return false;
} so there is no way to validate with method GET?
Peter
April 2012
As you can see you can pass the data to the function manually: $fieldset->validation->run(\Input::get())
mspace
April 2012
Thank you for that, it works.
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
mspace
April 2012
Peter
April 2012