Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
- class Welcome extends CI_Controller {
- function __construct() {
- parent::__construct();
- $this->load->spark('php-activerecord/0.0.1');
- }
- public function index() {
- $user = new User(array("email_address" => "beau.frusetta@gmail.com"));
- $user->save();
- ## This should show you the User record that you just created
- print_r($user);
- ## Now do a simple find by email address
- $user = User::find_by_email_address("beau.frusetta@gmail.com");
- print_r($user);
- ## Now do a simple find by primary key
- $user = User::find(1);
- print_r($user);
- $this->load->view('welcome_message');
- }
- }
Add Comment
Please, Sign In to add comment