Too few arguments to function when sending data from a form to the controller

0

I use Codeigniter and php, I try to make an update, I do the initial selection well, then I go to a form that receives the data that will be modified, but I have problems sending the data to the controller.

modify_view

<!DOCTYPE HTML>
<html lang="es">
    <head>
        <meta charset="UTF-8" />
        <title>Modificar Cliente</title>
    </head>
    <body>
        <h2>Modificar Cliente</h2>
        <?php
        echo form_open('cliente_buscar/mod');
    ?>
        <form method="POST">
            <?php foreach ($mod as $fila){ ?>
            <input type="text" name="docIdent" value="<?=$fila->DocIdent?>"/>
            <input type="text"  name="nombre" value="<?=$fila->Nombre?>"/>
            <input type="text" name="apellido" value="<?=$fila->Apellido?>"/>
            <input type="text" name="direccion" value="<?=$fila->Direccion?>"/>
            <input type="text" name="telefono" value="<?=$fila->Telefono?>"/>
            <input type="text" name="estado" value="<?=$fila->Estado?>"/>
            <input type="text" name="fechaIngreso" value="<?=$fila->FechaIngreso?>"/>
            <input type="text" name="password" value="<?=$fila->Password?>"/>
            <input type="submit" name="submit" value="Modificar"/>
            <?php } ?>
        </form>
        <a href="<?=base_url()?>">Volver</a>
    </body>
</html>

client_search (controller)

<?php
 defined('BASEPATH') OR exit('No direct script access allowed');

    class cliente_buscar extends CI_Controller{
        function __construct(){
            parent::__construct();
            $this->load->helper(array('form', 'url'));
            $this->load->library('form_validation');
            $this->load->database();
            //llamo o incluyo el modelo
            $this->load->model('main_model');
        }

        public function mod($DocIdent, $Nombre, $Apellido, $Direccion, $Telefono, $Estado, $FechaIngreso, $Password){ 

                $mod=$this->main_model->mod(
                        $DocIdent,                                                                        
                        $this->input->post("Nombre"),
                        $this->input->post("Apellido"),
                        $this->input->post("Direccion"),
                        $this->input->post("Telefono"),
                        $this->input->post("Estado"),
                        $this->input->post("FechaIngreso"),
                        $this->input->post("Password")
                        );
                if($mod==true){
                    //Sesion de una sola ejecución
                    $this->session->set_flashdata('correcto', 'Usuario modificado correctamente');
                }else{
                    $this->session->set_flashdata('incorrecto', 'No se pudo modificar el registro');
                }
                redirect(base_url());  
         }

I get this error message: Too few arguments to function client_search :: mod (), 0 passed in C: \ xampp3 \ htdocs \ CesdeCodeIgniter \ system \ core \ CodeIgniter.php on line 532 and exactly 8 expected

    
asked by Jhon Hernández 09.10.2018 в 01:17
source

1 answer

0

It was resolved by removing the arguments expected by the controller. The arguments are accessed by post.

    
answered by 09.10.2018 / 21:00
source