Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

前后端mvc经验 - webrebuild 2011 session

1,904 views

Published on

简单的介绍和讲解mvc以及自己经验过的传统前端与大前端的一些经验。

  • Be the first to comment

前后端mvc经验 - webrebuild 2011 session

  1. 1. MVC Enhance front endrank work @ youa WED teamhttp://t.sina.com/rank
  2. 2. We tell browserswhat to do.
  3. 3. •••
  4. 4. •••
  5. 5. ••
  6. 6. MVC http http
  7. 7. C,V
  8. 8. final class YourActionController extends BaseActionController { public function index() { $modal = $this->load(‘yourModel.php’); $data = $modal->getData(); $this->setView(‘test/index.tpl’, $data); }}
  9. 9. • View Controller••
  10. 10. ••big pipe• mobile app• Controller
  11. 11. •• 1• Controller
  12. 12. ••••Controller•Model controller
  13. 13. <?phpYourActionController extends BaseActionController { public function register() { $model = $this->load(‘account.model’); $username = $this->request(‘username’); $password = $this->request(‘password’); $model->register($username, $password); }}
  14. 14. <?phpYourActionController 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); } }}<?phpYourModel extends BaseModel { const EMAIL_TYPE = 1; const MOBILE_TYPE = 2; public function register($username, $password, $type) {}}
  15. 15. HTML Javascript Smarty CSSMVC framework PHP log
  16. 16. • V,C•
  17. 17. •••
  18. 18. thanks

×