⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Issue Installing



dziegler991
  • profile picture
  • Member

Posted 23 July 2018 - 17:12 PM

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 on xxx.com/xxx/index.php/Main/ddtracker 

 

 

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 */
Note: this is running on php7.2 and apache2.4.x.