0

I have already implemented the model funcion, the controller function and everything should be fine. I have followed the same steps i followed for another proyect, what am i doing wrong?

Controller

 public function intervalos_lista() {

        $crud = new grocery_CRUD();
        //$crud->unset_bootstrap();
        //---------------   Cargo la vista 'commons/header.php'  ------------- /
        $datos = array(
            'title' => "intervalos", // En la vista 'header' tendré una variable $title
            'username' => "Administrador"
        );

        $this->load->view('commons/header', $datos);

        $crud->set_language("spanish");
        $crud->set_theme('bootstrap');
        $crud->set_table('intervaloshorarios');


        $crud->columns('intervaloHorario','numeroVehiculos');

        $crud->display_as('idCarga','Nº Entrega');
        $crud->set_subject('Intervalo');
        $crud->set_relation('idCarga','entregas','numeroEntrega');
        //$crud->set_relation_

        $crud->callback_column('intervaloHorario', array($this, '_callback_webpage_url'));

        //Para que solo salgan los campos necesarios
        //$crud->columns('nombreCurso');
        //$crud->fields('nombreCurso');

        $output = $crud->render();

        //Para quitar el id simplemente quito aquí el campo del id de la base de datos
        //$crud->fields('lastName','firstName','extension','email','jobTitle');

        $this->_example_output($output);


        //---------------   Cargo la vista 'commons/footer.php'  ------------- /
        $this->load->view('commons/footer');
    }

  //Esto es para que me lleve a la vista de alumnos
    public function _callback_nombre_curso($intervaloHorario, $row) {
        return "<a href='" . base_url('Entregas_Controller/Entregas_Lista/' . $row->idIntervaloHorario) . "'>$intervaloHorario</a>";
    }

Link to next page(not working)

<a href="<?= base_url('Intervalos_Controller/intervalos_lista') ?>">Intervalos Horarios</a>

Link to exit(it works)

 <a href="<?= base_url('index.php/auth/logout') ?>">Salir</a>

Base_url

$config['base_url'] = 'http://localhost/herba/';
Jose
  • 310
  • 1
  • 12
  • You didn't remove the index.php? Check this link http://stackoverflow.com/questions/19183311/codeigniter-removing-index-php-from-url – GeorgeGeorgitsis Apr 28 '17 at 12:02
  • @satafaka, what's your point? Removal (hiding) of `index.php` from showing in the URL is optional and purely for aesthetics. Looks like his broken URL is actually missing `"index.php/"`. – Sparky Apr 28 '17 at 15:04

1 Answers1

1

You probably don't have .htaccess on your site. If you are using <a href="<?= base_url('index.php/auth/logout') ?>">Salir</a> and it works, you have to change your link to next page this way:

<a href="<?= base_url('index.php/Intervalos_Controller/intervalos_lista') ?>">Intervalos Horarios</a>
shaggy
  • 1,708
  • 2
  • 15
  • 17