Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue Installing #455

Open
dziegler991 opened this issue Jul 20, 2018 · 4 comments
Open

Issue Installing #455

dziegler991 opened this issue Jul 20, 2018 · 4 comments

Comments

@dziegler991
Copy link

Hi all,

I am having a bit of trouble installing Grocery CRUD. It is throwing this error after following the basic steps to get it working.

An uncaught Exception was encountered
Type: Error

Message: Cannot call constructor

Filename: /var/www/html/CodeIgniter/application/models/Grocery_crud_model.php

Line Number: 40

Backtrace:

File: /var/www/html/CodeIgniter/application/libraries/Grocery_CRUD.php
Line: 484
Function: model

File: /var/www/html/CodeIgniter/application/libraries/Grocery_CRUD.php
Line: 4607
Function: set_default_Model

File: /var/www/html/CodeIgniter/application/libraries/Grocery_CRUD.php
Line: 4625
Function: pre_render

File: /var/www/html/CodeIgniter/application/controllers/Main.php
Line: 27
Function: render

File: /var/www/html/CodeIgniter/index.php
Line: 308
Function: require_once

The Main.php file looks like this:

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
class Main extends CI_Controller {
 
function __construct()
{
        parent::__construct();
 
$this->load->database();
$this->load->helper('url');
/* ------------------ */ 
 
$this->load->library('grocery_CRUD');
 
}
 
public function index()
{
echo "<h1>Welcome to the world of Codeigniter</h1>";//Just an example to ensure that we get into the function
die();
}
 
public function ddtracker()
{
$crud = new grocery_CRUD();
$crud->set_table('ddtracker');
$output = $this->grocery_crud->render();
 
echo "<pre>";
print_r($output);
echo "</pre>";
die();
}
} 
/* End of file Main.php */
/* Location: ./application/controllers/Main.php */
@dziegler991
Copy link
Author

Note: this is running on php7.2 and apache2.4.x.

@bvrignaud
Copy link
Contributor

Use first letter in upercase to class name.

Try :

$crud = new Grocery_CRUD();

instead of :

$crud = new grocery_CRUD();

@dziegler991
Copy link
Author

Unfortunately that didn't change anything

@ADavidBarros
Copy link

Comment out the lines from Grocery_crud_model.php file

//
// function __construct()
// {
// // parent::__construct();
// }
https://github.com/bcit-ci/CodeIgniter/commit/c45caeac4f45b83fbb3655f62638ebcf913981c8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants