Skip to content

Instantly share code, notes, and snippets.

@p4ulypops
Created February 7, 2015 14:03
Show Gist options
  • Save p4ulypops/7d7debbdb158acce8485 to your computer and use it in GitHub Desktop.
Save p4ulypops/7d7debbdb158acce8485 to your computer and use it in GitHub Desktop.
<?php
class introduction extends CI_Controller
{
var $data = [];
private function __construct()
{
parent::__construct();
$this->load->modal('people_model');
$toArray = true;
$this->data['me'] = $this->people_model->get(['user' => '********'], $toArray);
}
private function _introduction()
{
$toArray = true;
$this->data['you'] = $this->people_model->get(['user' => '********'], $toArray);
$sayHi = 0;
foreach ($this->data['me']['interests'] as $interest) {
if (in_array($interest, $this->data['you']['interests'])) {
$sayHi++;
}
}
$this->load->view(($sayHi > 10 ? "hello" : "spam") . ".html");
}
public function index()
{
$this->_introduction();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment