Top Banner
PHP MVC Tutorial Just Do It Class01 BruceYang
20

PHP MVC Tutorial

Dec 05, 2014

Download

Software

 
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: PHP MVC Tutorial

PHP MVC TutorialJust Do It Class01

BruceYang

Page 2: PHP MVC Tutorial
Page 3: PHP MVC Tutorial

Why?

來源:http://www.febryadi.com

Page 4: PHP MVC Tutorial

Why?

來源:http://www.agileapps.co.uk/platform/mvc-architecture.html

Page 5: PHP MVC Tutorial

What?

來源:http://openhome.cc/Gossip/Rails/MVC.html

Page 6: PHP MVC Tutorial

What?

來源:http://openhome.cc/Gossip/Rails/MVC.html

Page 7: PHP MVC Tutorial

How?

1.簡單實作PHP MVC 架構 !

2.PHP MVC Framework

Page 8: PHP MVC Tutorial

簡單實做PHP MVC

• View

• Model

• Controller

Page 9: PHP MVC Tutorial

View<?php

class testView{

function display($data){

echo $data;

}

}

?>

Page 10: PHP MVC Tutorial

Model<?php

class testModel{

function get(){

return "Hello World";

}

}

?>

Page 11: PHP MVC Tutorial

Controller<?php

!

class testController

{

function show(){

$testModel = new testModel();

$data = $testModel->get();

$testView = new testView();

$testView->display($data);

}

}

?>

Page 12: PHP MVC Tutorial

Controller<?php

!

class testController

{

function show(){

$testModel = new testModel();

$data = $testModel->get();

$testView = new testView();

$testView->display($data);

}

}

?>

Page 13: PHP MVC Tutorial

Test<?php

require_once('testController.class.php');

require_once('testModel.class.php');

require_once('testView.class.php');

!

$testController = new testController();

$testController->show();

?>

Page 14: PHP MVC Tutorial

Tack a Break...

Page 15: PHP MVC Tutorial

PHP MVC Framework百家爭鳴~

Page 16: PHP MVC Tutorial

那我們該如何選擇呢?

Page 17: PHP MVC Tutorial

其實我也不知道?

Page 18: PHP MVC Tutorial

7 Best PHP Frameworks for 2014

來源:http://www.tisindia.com/blog/7-best-php-frameworks-2014/

Page 19: PHP MVC Tutorial

PHP MVC Framework 實作

Page 20: PHP MVC Tutorial

–BruceYang

“Thank you for listening…”