Welcome Guest, Not a member yet? Register   Sign In
DataMapper ORM v1.8.2

[eluser]Andy78[/eluser]
Has anybody created a dynamic menu library using datamapper yet? If not how do you handle menu generation?

[eluser]WanWizard[/eluser]
I use nested sets to store tree structures in a database. And I have a method that generates a nested unordered list from a tree structure, that can be easily styled in CSS.

Datamapper has an extension that can deal with tables containing nested sets. Check the docs.

[eluser]Andy78[/eluser]
That seems quite complicated and perhaps overkill for what I want to do. I understand what your saying and generating a nested unordered list from a tree structure makes sense but translating the info in the docs about nested sets into an actual menu is difficult without specific examples of setting up the database table and extracting the menu items... anybody got a working example of this in use?

[eluser]AlexMason[/eluser]
When i add the bootstrap:
require_once APPPATH.'/third_party/datamapper/bootstrap.php';

I get this error:
Code:
Warning: require_once(application//third_party/datamapper/bootstrap.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\filesite\index.php on line 197

Fatal error: require_once() [function.require]: Failed opening required 'application//third_party/datamapper/bootstrap.php' (include_path='.;C:\\xampp\\php\\PEAR') in C:\xampp\htdocs\filesite\index.php on line 197

[eluser]WanWizard[/eluser]
The error is pretty clear: either the file isn't there, or your webserver doesn't have access to it.

[eluser]Andy78[/eluser]
The automatic timestamps no longer seem to be working since i updated to the latest version. Either that or Iv did something to stop it working.

[eluser]WanWizard[/eluser]
Just tested it here, and I don't have any problem.

[eluser]Andy78[/eluser]
[quote author="WanWizard" date="1335525696"]Just tested it here, and I don't have any problem.[/quote]

Thats strange, I just ran the profiler and looked at the query's it does include the created field in the insert query but field value to be inserted is showing as empty: ''. Any idea as to what might be causing this? I cant see anything wrong.

[eluser]Andy78[/eluser]
Rebooted my pc and tried to log back into my dev site and now getting an error:

Fatal error: Uncaught exception 'Exception' with message 'Unable to call the method "from_array" on the class User' in C:\xampp\htdocs\get_stuffed2\application\libraries\datamapper.php:1188 Stack trace: #0 C:\xampp\htdocs\get_stuffed2\application\controllers\login.php(31): DataMapper->__call('from_array', Array) #1 C:\xampp\htdocs\get_stuffed2\application\controllers\login.php(31): User->from_array(Array, Array) #2 [internal function]: Login->admin_login() #3 C:\xampp\htdocs\get_stuffed2\system\core\CodeIgniter.php(359): call_user_func_array(Array, Array) #4 C:\xampp\htdocs\get_stuffed2\index.php(207): require_once('C:\xampp\htdocs...') #5 {main} thrown in C:\xampp\htdocs\get_stuffed2\application\libraries\datamapper.php on line 1188

what the hell is going on with this, everything was working...

[eluser]Andy78[/eluser]
Ok I reverted back to an earlier version of my project and it solved both problems but when I upgraded to the latest version of datamapper again it stopped automatically updating the timestamps again so there must be some problem with it.

When upgrading do I only have to copy the library file and nothing else? This is what I have done.




Theme © iAndrew 2016 - Forum software by © MyBB