Ejemplo n.º 1
0
 <?php 
require_once "../common/HTMLView.php";
require_once "src/LikeController.php";
session_start();
//http://yuml.me/81b86d6b
$c = new LikeController();
$htmlBody = $c->doLike();
$view = new HTMLView();
$view->echoHTML($htmlBody);
Ejemplo n.º 2
0
        return $ret;
    }
    public function didUserPressLike()
    {
        if (isset($_POST["iLike"])) {
            return true;
        }
        return false;
    }
}
class LikeController
{
    private $view;
    private $model;
    public function __construct()
    {
        $this->model = new LikeModel();
        $this->view = new LikeView($this->model);
    }
    public function doControll()
    {
        if ($this->view->didUserPressLike()) {
            $this->model->addLike();
        }
        return $this->view->showLikes();
    }
}
$c = new LikeController();
$htmlBody = $c->doControll();
$view = new HTMLView();
$view->echoHTML($htmlBody);