• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
controllers and model

I'm a beginner with codeigniter, I'm trying to insert the records into the database, but the in the editor phpstorm I'm using showing the model as an unidentified. someone please help me with this.

public function index()
       $data['title']= 'Workload';
       $data['workload']  = $this->Workload_Model->get_workload();
       $this->load->view('administrator/Workload', $data);
$data['workload']  = $this->Workload_Model->get_workload();
 workload_model in this line is showing not found.


What is the model file name? Workload_Model or Worklord_model? Also, when you declared the class what name did you use? Workload_Model or Worklord_model? It may be the way you named your model class.

Might be a file and class naming problem. I suspect it is the uppercase M in Model. The file name should be Workload_model.php  (with that exact character case usage) and the class code should be as follows

PHP Code:
class Workload_model extends CI_Model 

Change the controller to look like this

PHP Code:
$data['workload' $this->workload_model->get_workload(); 

not an error it should work just fine phpStorm doe's not see all of the CodeIgniter
classes in the frame work, there are work around's in the forums.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.