Skip to content

Instantly share code, notes, and snippets.

@tranquangchau
Created August 12, 2015 10:34
Show Gist options
  • Save tranquangchau/6ab8c47a11aab8a41ebc to your computer and use it in GitHub Desktop.
Save tranquangchau/6ab8c47a11aab8a41ebc to your computer and use it in GitHub Desktop.
$this->config->item('base_url');
http://www.codeigniter.com/user_guide/general/ancillary_classes.html
@tranquangchau
Copy link
Author

cách viết hay ho
http://chris-schmitz.com/cleaning-up-your-codeigniter-controllers/

return $this->db
->where('id', $product_id)
->update('products', $attributes);

public function update($product_id, $input)
{
$attributes = array(
'name' => $input['name'],
'price' => $input['price'],
'short_description' => $input['short_description'],
'long_description' => $input['long_description']
);

    return $this->db
        ->where('id', $product_id)
        ->update('products', $attributes);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment