Last active
December 29, 2015 16:29
-
-
Save felixmc/7697468 to your computer and use it in GitHub Desktop.
simple code igniter model for a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Static_Page_Model extends CI_Model { | |
function __construct() { | |
// Call the Model constructor | |
parent::__construct(); | |
} | |
public function createPage ($data) { | |
$data['date_created'] = date('Y-m-d H:i:s'); | |
$this->db->insert("pages", $data); | |
} | |
public function getPage ($slug) { | |
$this->db->where("slug", $slug); | |
return $this->db->get("pages")->row_array(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment