コード例 #1
0
ファイル: index.php プロジェクト: fg222cj/php-labbar
 <?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);
コード例 #2
0
ファイル: liketest.php プロジェクト: hg222dt/1dv408
        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);