Hello everyone,
I'm new to GC, I've been building a site for a couple of months and everything is working fine, recently I decided to improve its functionality by including some CRUD tables via GC.
I've loaded a sample MYSQL table shown in one of the GC tutorials and I put all the files into the right CI folders. I've created a new method into a controller and I send the $output given by the render to the view, and that worked ok. So I can see the table, with the rigth css theme, buttons, links etc. However, I have a BIG PROBLEM, as none of the CRUD functions works I'm only getting 404 errors.
The controller I've got is this (I got several controllers, but the CRUD tables are for the admin only):
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class User_admin_controller extends CI_Controller { function __construct() { parent::__construct(); $this->load->database(); $this->load->helper('url'); $this->load->library('grocery_CRUD'); } public function hour_range() { $this->grocery_crud->set_table($this->db->dbprefix('employees')); $output = $this->grocery_crud->render(); $this->sendhourangetoview($output); } function sendhourangetoview($output = null) { $this->load->view('user_manager/admin/hour_range.php',$output); } } ?>
for information I have a line into my routes.php
$route['hour_range'] = 'user_admin_controller/hour_range';
and on my config.php i've got some of this:
$config['url_suffix'] = '.html'; $config['base_url'] = 'http://localhost/geoda/';
the url that I see when pointing to one of the "edit buttons" is this
"http://localhost/geoda/hour_range/edit.html/1002"
to the view button:
http://localhost/geoda/hour_range/read.html/1002
to the add button:
href="http://localhost/geoda/hour_range/add.html"
Somehting tells me there is something to do with the routes (which are normally working fine) So, I've tried changing the 'base_url' for GC using the set_crud_url_path function, but nothing seems to work... :(
The only thing i can say is....PLEASE HELP!! I'm really a hand with this!