• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Starting with CodeIgniter setup: suggestions & best practices

[eluser]pisio[/eluser]
[quote author="Aken" date="1354062391"]CI's active record isn't an ORM. Setters and getters aren't helpful in its case. (Also, __call() is meant for methods, not properties.)

There's no set date for 3.0's release.[/quote]
Code:
class   User_model  extends  CI_Model{
//  construct //
    public function getUsers($params)
{
// $params = array('username','email','website'); //  is stupid to  ask for  md5[password] :)
      $this->data->getUsers =  $this->db->select($params)->get('users')->result();
}
Code:
class User  extends CI_Controller {
//  construct //
   function  listAllUsers()
{
     $this->user_model->getUsers(array('username','email','website','last_active'));
    
$this->load->view('/site/header');
$this->load->view('/site/body/listingUsers');
$this->load->view('site/footer');

}
}
Code:
<?php
//ListingUsers  html
foreach($this->data->getUsers  as $users)
{
print_r($users);

}

?>

That was my idea. I wanted to show you . Smile And tnx... I dont know why i write __call instead __set. Just my bad Smile


Messages In This Thread
Starting with CodeIgniter setup: suggestions & best practices - by El Forum - 11-28-2012, 03:56 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.