Welcome Guest, Not a member yet? Register   Sign In
Problem with submit a form and redirect


this is the controller function with some simplified code:

PHP Code:
public function index() {
view('layout', ['contactform' => $this->getContactform]);

public function 
getContactform() {
  if (
$this->form_validation->withRequest($this->request)->run(NULL'contact') === true) {


In my template:
PHP Code:
echo $contactform// Object of class CodeIgniter\HTTP\RedirectResponse could not be converted to string 

I know the reason, but how can i fix this? If the form is valid i want to make a redirect but in this case the variable in the template is an object and not the view. This is the error message:
Object of class CodeIgniter\HTTP\RedirectResponse could not be converted to string

Theme © iAndrew 2016 - Forum software by © MyBB