DataMapper 1.6.0 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: DataMapper 1.6.0 (/showthread.php?tid=11358) Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
DataMapper 1.6.0 - El Forum - 12-08-2008 [eluser]hugle[/eluser] Thank you OverZealous.com very much! It now works as used to work always Good luck using DataMapper! DataMapper 1.6.0 - El Forum - 12-08-2008 [eluser]hugle[/eluser] Yesterday I saw, that neither header ('Location: /'); nor redirect () do not work. Today I have reproduced it, and spotted, that if I put datamaper, in autoload.php like: Code: $autoload['libraries'] = array('datamapper'); and make simple Test controller: Code: class Test extends Controller { When I navigate to the page, and make View Source, the content is " " (one whitespace) When I remove datamapper from autoload, refresh the page, it loads without a " ". Anyone spotted similar issues ? or even knwo a workaround ? Thanks ! DataMapper 1.6.0 - El Forum - 12-08-2008 [eluser]OverZealous[/eluser] Are you adding database to your autoload first? You need database in there as well. Please take a minute to read over the DataMapper User's Guide. It explains a lot of this, and other problems you have been having, and it isn't very long. DM is slightly different than using straight CodeIgniter in some respects. Also, make sure you don't have any files with leading spaces before the <?php. This is a well known problem with PHP. It's even more of an issue if you have files being saved as UTF-8 with a leading BOM (byte-order mark). Search the web for "PHP BOM" to see how to remove it. DataMapper 1.6.0 - El Forum - 12-08-2008 [eluser]hugle[/eluser] Yes OverZealous, I have tried adding database, like Code: $autoload['libraries'] = array('database', 'datamapper'); I also tried to load even more libraries, redirects work until I add the 'datamapper' library.. I went through the documentation but somehow I didn't find anything similar that could lead to such a behavior. It is strange, because when I remove datamapped from autoloader, it starts to work, so I think it is not the PHP BOM issue, or white spaces before the <?php. And yes, I was using UTF-8, also tried to save file as windows-1257 - same result. I think maybe there could be a white space somewhere in DM library? DataMapper 1.6.0 - El Forum - 12-08-2008 [eluser]OverZealous[/eluser] I know that the DM I am using, the latest one, has no whitespace issue. The whitespace/BOM is probably occuring within one of your models, or within a language file, or something similar. DM loads all of the models within your application/models directory on init. Therefore, if any php file in this directory has this problem, it will show up. DataMapper 1.6.0 - El Forum - 12-08-2008 [eluser]hugle[/eluser] OverZealous , thans for your thoughts. Well, i went a bit further now. So I started checking the libraries and the models directories. What I came up with, is that problem lays somethere in MY_Form_validation.php. [update] after looking into it, I've spoted some whitespace. thanks for your time, I really appreaciate it, OverZealous. Now i understend CI and DM even more. cheers, Jaroslav DataMapper 1.6.0 - El Forum - 12-08-2008 [eluser]OverZealous[/eluser] Good Stuff! :-) I can't stand those time-consuming, little tiny bugs. I think I spend twice as long fixing bugs that are bizarre and tiny than I do the severe ones! DataMapper 1.6.0 - El Forum - 12-08-2008 [eluser]hugle[/eluser] Strange this bug didn't came out earlier - bastard but thanks again, really! I must agree with you OverZealous, those little bugs consume too much time sometimes... sometimes you need to write a script which takes <10 mins, instead of this it eats you 2 hours or so )) DataMapper 1.6.0 - El Forum - 12-09-2008 [eluser]hugle[/eluser] Hello It is me again, hope you did miss me ))) I'm playing with Relationships, my structure is as follows: forum has many topic topic has many post here is an example I'm working on Code: $f = new Forum(); Part1 works well, but I'm stuck at part2. Can't figure out how I can make relations between forum<>topic<>post and count it... Maybe some of you have some examples or thoughts on this approach? Thank you DataMapper 1.6.0 - El Forum - 12-09-2008 [eluser]stensi[/eluser] Version 1.6.0 has been released! View the Change Log to see what's changed. In short, there are now advanced queries. Let's go through an example to see the benefits of these. Let's say we have a User model and a Group model. A group can have many users but a user can only have one group. Here's how you would look up all users belonging to the Moderator group without the advanced query: Code: // Create user object Here's how you would do the above, but using an advanced query: Code: // Create user object As you can see, it's a big time saver but not just in the amount of code you write, but also in the number of database queries and overall processing time. There are alternate usage formats as well. Here's one of the variants of the above: Code: // Create and get Moderator group Or you could use the advanced Get By: Code: $u->get_by_related($g); Enjoy :-) |