⚠ 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

Upper Case initial for model



ComputingFroggy
  • profile picture
  • Member

Posted 17 April 2015 - 21:20 PM

Hi,

 

I have just downloaded Grocery Crud (v. 1.5) ... and I got an error straight away.

 

I am using CodeIgniter 3.0 and all classes name should have an initial upper case.

So I have changed the file name from grocery_crud_model.php to Grocery_crud_model.php.

I have also changed the class name

class grocery_CRUD_Model  extends CI_Model  {
to

class Grocery_CRUD_Model  extends CI_Model  {
 

 

Also, following The simplest example, the instruction

  $this->_example_output($output);

will fail as there's no _example_output method defined in the controler ! ! !

And then, we can see somewhere else in the documentation, the creation of that method:

function _example_output($output = null)
    {
        $this->load->view('our_template.php',$output);    
    }

However the view that comes with the download is: template.php (I renamed it gcrud_template.php to be more specific) !

And I replace the instruction

  $this->_example_output($output);

by

  $this->load->view('gcrud_example.php', $output);
 

... and now, Grocery Crud is working ! ! !

 

Just to let know anyone who might be interested.

 

 

Enjoy,

L@u


Markus Sällinen
  • profile picture
  • Member

Posted 23 April 2015 - 21:47 PM

If you want to use the examples then application/controllers/examples.php need to have an initial uppercase too so change it to application/controllers/Examples.php

 

Works fine on Windows and Wamp but not on linux.

 

And thanks ComputingFroggy. You saved me a lot of time :)