Created
February 7, 2015 14:03
-
-
Save p4ulypops/7d7debbdb158acce8485 to your computer and use it in GitHub Desktop.
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 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