Ejemplo n.º 1
0
 /**
  * デバイス毎の出力方法を自動で変更する、ファサード
  * Enter description here ...
  */
 public function setDevice($device = DEVICE_TYPE_PC)
 {
     switch ($device) {
         case DEVICE_TYPE_MOBILE:
             if (USE_MOBILE === false) {
                 exit;
             }
             $this->response->setContentType('text/html');
             $this->setView(new MobileView(true, DEVICE_TYPE_MOBILE));
             break;
         case DEVICE_TYPE_SMARTPHONE:
             $this->setView(new SmartphoneView(true, DEVICE_TYPE_SMARTPHONE));
             break;
         case DEVICE_TYPE_PC:
             $this->setView(new SiteView(true, DEVICE_TYPE_PC));
             break;
         case DEVICE_TYPE_ADMIN:
             $this->setView(new AdminView());
     }
     $this->deviceSeted = true;
 }