/** * Loads the database instance, if the database is not already loaded. * * @return void */ public function __construct() { // Eight global instance $this->core = Eight::instance(); $this->obj = Eight::instance(); $this->db = Eight::instance()->db; }
/** * Loads URI, and Input into this controller. * * @return void */ public function __construct() { if (Eight::$instance == nil) { // Set the instance to the first controller loaded Eight::$instance = $this; } // Input should always be available $this->input = Input::instance(); }
public static function logged_in() { if (str::e($_COOKIE[Eight::config('facebook.api_key') . '_user'])) { return FALSE; } else { if (intval(Eight::instance()->fb->user) > 0) { return TRUE; } else { return FALSE; } } }
public static function db() { if (!is_a(Eight::instance()->db, 'Database')) { return Database::instance(Eight::instance()->default_conn); } else { return Eight::instance()->db; } }
/** * Captures the output that is generated when a view is included. * The view data will be extracted to make local variables. This method * is static to prevent object scope resolution. * * $output = View::capture($file, $data); * * @param string filename * @param array variables * @return string */ protected static function capture($eight_view_filename, array $eight_view_data) { return Eight::instance()->_eight_load_view($eight_view_filename, $eight_view_data); }
/** * Method: rule_xss_clean * XSS clean string. * * Parameters: * str - string */ protected function rule_xss_clean() { $this->value = Eight::instance()->input->xss_clean($this->value); }