Problem with Codes |
In your attachment, it looks like you name your controller "Controller.php". This is a recipe for trouble. Controller is a reserved name in CI for a specific type of class.
It's also very odd to address to a page on your website with a URL like www.mysite.com/controller/debtor_print_view, isn't it? Rename the controller to Invoices.php. Don't forget to change the class name inside the controller too. Your controller function starts with this line: PHP Code: $this>load>model('invoices_model'); It should be: PHP Code: $this->load->model('invoices_model'); Next, in your controller, you are loading this view: PHP Code: $this->load->view('backend/index', $page_data); CI is looking for a view named application/views/backend/index.php. But the view you mention in the attachment is named debtor_print_view.php. You can't expect your application to work that way. Also, in your model, you have this line: PHP Code: $this->db->from('invoice '); Remove the space character after invoice, because the Query Builder will try to open a table named "invoice ", which most likely not exists. Last but not least, your view has a bunch of wrong code. Remove all of it. Just put this in your view, to test if the controller passes the data correctly: PHP Code: <?php Finally, run your application and call the url www.mysite.com/invoices/debtor_print_view |
Messages In This Thread |
Problem with Codes - by Jay01 - 11-05-2016, 11:44 PM
RE: Problem with Codes - by Wouter60 - 11-06-2016, 07:07 AM
RE: Problem with Codes - by Jay01 - 11-06-2016, 12:28 PM
RE: Problem with Codes - by Wouter60 - 11-06-2016, 02:59 PM
RE: Problem with Codes - by Jay01 - 11-06-2016, 07:03 PM
RE: Problem with Codes - by Jay01 - 11-07-2016, 11:48 PM
RE: Problem with Codes - by Jay01 - 11-07-2016, 10:52 AM
RE: Problem with Codes - by Wouter60 - 11-07-2016, 11:46 AM
RE: Problem with Codes - by Jay01 - 11-07-2016, 08:29 PM
RE: Problem with Codes - by Wouter60 - 11-08-2016, 12:04 AM
RE: Problem with Codes - by Jay01 - 11-08-2016, 01:59 AM
RE: Problem with Codes - by Wouter60 - 11-08-2016, 08:22 AM
|