MVC
                            Enhance front end

rank work @ youa WED team
http://t.sina.com/rank
We tell browsers
what to do.
•
•
•
•
•
•
•
•
MVC
      http




      http
C,V
final class YourActionController extends BaseActionController {
      public function index() {
          $modal = $this->load(‘yourModel.php’);
          $data   = $modal->getData();
          $this->setView(‘test/index.tpl’, $data);
      }
}
•   View   Controller

•
•
•
•big pipe
•                      mobile app
•         Controller
•
•   1

•       Controller
•
•
•
•Controller
•Model      controller
<?php
YourActionController extends BaseActionController {
      public function register() {
         $model = $this->load(‘account.model’);
         $username = $this->request(‘username’);
         $password = $this->request(‘password’);
         $model->register($username, $password);
      }
}
<?php
YourActionController extends BaseActionController {
       public function register() {
            $model = $this->load(‘account.model’);
            $emailType = 1;
            $mobileType = 2;
            $type = $this->request(‘usertype’);
            if ($type==$emailType) {
                   $model->register($username, $password, $type);
             }
       }
}


<?php
YourModel extends BaseModel {
      const EMAIL_TYPE = 1;
      const MOBILE_TYPE = 2;
      public function register($username, $password, $type) {}
}
HTML    Javascript


                         Smarty
          CSS
MVC framework     PHP    log
•   V,C



•
•
•
•
thanks

前后端mvc经验 - webrebuild 2011 session