PHP MVC Frameworks MVC Fundamentals Soft Uni Team

  • Slides: 11
Download presentation
PHP MVC Frameworks MVC Fundamentals Soft. Uni Team Technical Trainers Software University http: //softuni.

PHP MVC Frameworks MVC Fundamentals Soft. Uni Team Technical Trainers Software University http: //softuni. bg

Questions sli. do #PHPMVC 2

Questions sli. do #PHPMVC 2

PHP MVC Frameworks Course Objectives & Program

PHP MVC Frameworks Course Objectives & Program

Pipeline HTTP Request GET /users/register HTTP/1. 1 Host: www. site. com Prepares Request Objects

Pipeline HTTP Request GET /users/register HTTP/1. 1 Host: www. site. com Prepares Request Objects Web Server Mod Rewrite index. php Transfers control to script 4

Pipeline (2) index. php Knows everything about the HTTP Request via $_SERVER and $_REQUEST

Pipeline (2) index. php Knows everything about the HTTP Request via $_SERVER and $_REQUEST Decides which class->method by using the Request URI Instantiates dependencies Passes GET as arguments Fills data from FORMs into Object arguments

Pipeline (3) GET /users/register HTTP/1. 1 Host: www. site. com Dependency public function register

Pipeline (3) GET /users/register HTTP/1. 1 Host: www. site. com Dependency public function register (View. Interface $view) { return $view->render(); }

Pipeline (4) POST /users/register HTTP/1. 1 Host: www. site. com public function register. Process

Pipeline (4) POST /users/register HTTP/1. 1 Host: www. site. com public function register. Process ( User. Service. Interface $service, Dependencies Response. Interface $response, Form Data Register. Binding. Model $model) { $service->add($model->name, $model->pass); return $response->redirect("login"); }

Pipeline (5) POST /articles/edit/4 HTTP/1. 1 Host: www. site. com GET Params public function

Pipeline (5) POST /articles/edit/4 HTTP/1. 1 Host: www. site. com GET Params public function edit. Article. Process (int $id, Article. Service. Interface $service, Dependencies Response. Interface $response, Form Data Edit. Article. Binding. Model $model) { $service->edit. By. Id($id, $model->…); return $response->redirect("view. All"); }

PHP MVC Frameworks – MVC Fundamentals ? s n o i t s e

PHP MVC Frameworks – MVC Fundamentals ? s n o i t s e u Q ? ? ? https: //softuni. bg/courses/php-mvc-frameworks

License § This course (slides, examples, demos, videos, homework, etc. ) is licensed under

License § This course (slides, examples, demos, videos, homework, etc. ) is licensed under the "Creative Commons Attribution. Non. Commercial-Share. Alike 4. 0 International" license § Attribution: this work may contain portions from § “PHP/My. SQL" course by Soft. Uni under CC-BY-NC-SA license 10

Free Trainings @ Software University § Software University Foundation – softuni. org § Software

Free Trainings @ Software University § Software University Foundation – softuni. org § Software University – High-Quality Education, Profession and Job for Software Developers § softuni. bg § Software University @ Facebook § facebook. com/Software. University § Software University @ You. Tube § youtube. com/Software. University § Software University Forums – forum. softuni. bg