Welcome Guest, Not a member yet? Register   Sign In
problem with ORM lib & CI 2.1.0
#1

[eluser]7amza[/eluser]
Hi!
i have some problem wit the new ORM lib (using its boostrape) & CI 2.1.0 ! its the first time i use them .. all my old/current projectd are based on CI 1.7.X and ORM old versiosn(1.8.0) ..
so after a clean installation , installing Phil template lib and aut-loading libs i need i'm getting the following (log) errors :

Quote:ERROR - 2012-06-02 20:47:09 --> 404 Page Not Found --> templates

when i comment this line the error disappear !

Code:
$path = base_url().'templates/admin/css/'.$filename.'.css';
   echo "<link type='text/css' rel='stylesheet' href='".$path."' /> "."\n";

the second error is :
group.php !:

Code:
<?php

class Group extends DataMapper {

var $model = 'group';
var $table = 'groups';

var $has_many = array('user');


function groups_list($add_phrase = FALSE){
  $gs = new group();
  $gs->get();
  $groups = array();
  foreach($gs as $g){
   $groups[$g->id] = $g->title;
  }
  return $groups;
  
}
  
  
}

Controller :
Code:
//..
$data['groups_list'] = new group();
$data['groups_list']->groups_list();
//..

Views/Template :

Code:
echo form_label('Choose the group','group_id');
echo form_dropdown('group_id',$groups_list,post('group_id'));

// output : Null select tag!!


Code:
//in controller
$g = new group();
$g->get();
foreach($g as $p){
echo $p->id;
}
//output : 1 2 3 4

any solution !!
#2

[eluser]7amza[/eluser]
any help guys?
#3

[eluser]WanWizard[/eluser]
CI 2.0.0?

The current (1.8.2) version of Datamapper requires a third party bootstrap loader, which officially only supports CI 2.0.3+. For CI 2.0.0-2.0.2 you need to hack the core, and disable the load_class() function in system/core/Common.php.

If you've done so, DM should run fine on CI 2.0.0, it does here without problems.

In your controller, what is get_list()? According to your example, the method is called grouplist?
#4

[eluser]7amza[/eluser]
Hi Harron
i updated the thread




Theme © iAndrew 2016 - Forum software by © MyBB