php - CodeIgniter Form_Validation without actual form
Get the solution ↓↓↓Solution:
It depends on the version of codeigniter that you are using
codeigniter 3.0 :
you can use set_data method to validate your custom data
$data = array(
'username' => 'johndoe',
'password' => 'mypassword',
'passconf' => 'mypassword'
);
$this->form_validation->set_data($data);
codeigniter 2.X :
set$_POST
values manually
$_POST'username'] = 'johndoe';
$_POST['password'] ='mypassword';
$_POST['passconf'] = 'mypassword';
Common :
for the common part thankfully they both still useform_validation->run()
andform_validation->set_rules(<SPECIFIC ATTRIBUTE RULES>)
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: call to a member function store() on null
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.