Hallo!
I'm new to groceryCRUD and i am tryng to display a simple table with all functionalities, the implementation is not in the index method as reccomanded in the tutorial.
i am using a wamp
base url:
$config['base_url'] = 'localhost/main_folder/';
controller:
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Welcome extends CI_Controller { public function index() { $this->load->helper('url'); $this->load->view('home'); } public function categorie() { $this->load->helper('url'); $this->load->library('grocery_CRUD'); $crud = new grocery_CRUD(); $crud->set_table('categorie'); $crud->set_subject('Categoria'); $crud->fields('nome','descrizione','note'); $output = $crud->render(); $this->load->view('categorie',$output); } }
the view is very long due the css theme i used so i will include the relevant (i think) parts:
<?php foreach($css_files as $file): ?> <link type="text/css" rel="stylesheet" href="http://<?php echo $file; ?>" /> <?php endforeach; ?> <?php foreach($js_files as $file): ?> <script src="http://<?php echo $file; ?>"></script> <?php endforeach; ?> <?php echo $output; ?>
when i click on add edit and view i get a 404 error from codeigniter with urls i can see are not good:
http://localhost/main_folder/index.php/localhost/main_folder/index.php/categorie/add
i tryed to put the base url back to:
$config['base_url'] = '';
but the url comes up very strange:
http://[::1]/main_folder/index.php/categorie/add
i also tryed to put the http:// :
$config['base_url'] = 'http://localhost/pannello_preventivi/';
like this i managed to have a clean url:
http://localhost/main_folder/index.php/categorie/add
but still getting 404 error, can someone help me please?