I thought i would just throw in the example that was in the zip when i downloaded DataMapper 1.8.2, and check out an working example to learn how to use it…. but… now I’ve tried for 3-4 hours to get it working -.-’ to find out what I’ve done wrong. Deleted everything, downloaded everything again, and copied it all ind again, many many many times. Looked through every single line in all config files, but i really can’t figure out what’s wrong -.-’
It creates the databases right, and fills some data in it, and then…
1. When I try to go forward, this shows up in the URL
hxxp://localhost/codeigniter_testing/index.php/admin/<?= site_url(‘admin/init’) ?>
annoying, but easy to jump to /admin/init.
2. On the init site where i create a user, this shows up om top of the page:
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: datamapper/htmlform.php
Line Number: 52
tried filling in the form anyways.
3. Then I get a page only with this text:
Fatal error: Uncaught exception ‘Exception’ with message ‘Unable to call the method “from_array” on the class User’ in C:\wamp\www\codeigniter_testing\application\libraries\datamapper.php:1277 Stack trace: #0 [internal function]: DataMapper->__call(‘from_array’, Array) #1 C:\wamp\www\codeigniter_testing\application\controllers\admin.php(166): User->from_array(Array, Array) #2 [internal function]: Admin->init(‘save’) #3 C:\wamp\www\codeigniter_testing\system\core\CodeIgniter.php(359): call_user_func_array(Array, Array) #4 C:\wamp\www\codeigniter_testing\index.php(203): require_once(‘C:\wamp\www\cod…’) #5 {main} thrown in C:\wamp\www\codeigniter_testing\application\libraries\datamapper.php on line 1277
This is really really pissing me off xD I thought I was about to learn about the DataMapper, but ended up using 3-4 hours trying to get the example working, without luck -.-’ Really hope someone can help me xD