_assign_libraries error when adding to the database |
[eluser]Tomer Simis[/eluser]
Hello guys, im new to the frameworks world and i choose the codeigniter to start. I saw the videos on the site and a few tutorials on the internet. Now im practicing, and im getting a error when im doing a insert to the database. The error: Fatal error: Call to undefined method Pedidos::_assign_libraries() in C:\wamp\www\codeigniter\system\libraries\Loader.php on line 185 Controller Code: class Pedidos extends Controller{ Model Code: class Pedidos_model extends Model{ View Code: <html> Please, help me guys :down: Sorry for any english mistake, im brazillian Thanks
[eluser]imn.codeartist[/eluser]
Instead of This code Code: function enviar(){ Try this and see if this work first Code: function enviar(){ Your code has a lot needs to modify but try using some core php stuffs first
[eluser]Tomer Simis[/eluser]
i got the same error Fatal error: Call to undefined method Pedidos::_assign_libraries() in C:\wamp\www\codeigniter\system\libraries\Loader.php on line 185 Please, help me =/
[eluser]Colin Williams[/eluser]
It seems that you have accidentally altered the core model class, which is where that method exists.
[eluser]Tomer Simis[/eluser]
I've downloaded code igniter again and replaced the files, and i still got the error. I have uploaded my codeigniter folder with my controllers,views and models: http://www.radioelevasom.com.br/codeigniter.rar Help me please
[eluser]Tomer Simis[/eluser]
I've found a solution for the bug on the codeigniter bug tracker. I deleted the line 185 on the Loader class and the error stopped. Now im getting another error: Code: A PHP Error was encountered And before this error, i was getting another error: undefined index when i was posting, so i moved the POST vars to the model and the error stopped. PS: I have changed the "Pedidos" model name for "PedidosModel", and the filename for "pedidosmodel.php" Please guys, help me
[eluser]jedd[/eluser]
Yes - removing the _assign_libraries() call from the core Loader class is likely to break other things. The problem here is that you're experiencing a unique problem. This is why we tend to think it's something you've changed or done, rather than something wrong with the CI files. Hmm, I was about to suggest you go through the same process again, only this time checking each time you add a new file, or at least confirming the basic system is working, but re-scanning your original question again I see that this bit might be a problem: Code: // controller ... Code: // model ... In your controller, you really need to load the name of your model - in this case Pedidos_model and not the name of your controller (pedidos). Try changing your controller to: Code: $this->load->model('Pedidos_model');
[eluser]skunkbad[/eluser]
I just had the same error, and it turned out that I was calling a model, and the model file did exist, but had the wrong model name: file: orders.php class Not_orders extends Model { //... }
[eluser]skaterdav85[/eluser]
I was getting something similar. My error was: codeigniter Fatal error: Call to undefined method About_model::_assign_libraries() on line 185 but then i realized that my About_model class did not extend the Model class. So if you haven't checked already, check to make sure your model is extending the Model class. |
Welcome Guest, Not a member yet? Register Sign In |