CakePHP i CakePHP About the Tutorial CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers guarantee a strict, but natural separation of business logic from data and presentation layers. Audience This tutorial is meant for web developers and students who would like to learn how to develop websites using CakePHP. It will provide a good understanding of how to use this framework. Prerequisites Before you proceed with this tutorial, we assume that you have knowledge of HTML, Core PHP, and Advance PHP. We have used CakePHP version 4.0.3 in all the examples. Copyright & Disclaimer Copyright 2020 by Tutorials Point (I) Pvt. Ltd. All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or in this tutorial, please notify us at [email protected] ii CakePHP Table of Contents About the Tutorial ........................................................................................................................................... ii Audience .......................................................................................................................................................... ii Prerequisites .................................................................................................................................................... ii Copyright & Disclaimer .................................................................................................................................... ii Table of Contents ........................................................................................................................................... iii 1. CakePHP ― Overview ............................................................................................................................... 1 Advantages of CakePHP ................................................................................................................................... 1 CakePHP Request Cycle ................................................................................................................................... 1 2. CakePHP — Installation ............................................................................................................................ 3 Installing Composer ......................................................................................................................................... 3 Installing CakePHP ........................................................................................................................................... 3 3. CakePHP — Folder Structure ..................................................................................................................... 5 Folder Structure ............................................................................................................................................... 5 Naming Convention ......................................................................................................................................... 6 4. CakePHP — Project Configuration ............................................................................................................. 8 Environment Variables .................................................................................................................................... 8 General Configuration ..................................................................................................................................... 8 Databases Configuration ................................................................................................................................. 9 Email Configuration ....................................................................................................................................... 12 5. CakePHP — Routing ................................................................................................................................ 14 Introduction to Routing ................................................................................................................................. 14 Connecting Routes ........................................................................................................................................ 14 Passed Arguments ......................................................................................................................................... 17 Generating URLs ............................................................................................................................................ 19 Redirect Routing ............................................................................................................................................ 22 6. CakePHP — Controllers ........................................................................................................................... 24 iii CakePHP AppController ................................................................................................................................................ 24 Controller Actions .......................................................................................................................................... 25 Redirecting .................................................................................................................................................... 25 Loading Models ............................................................................................................................................. 28 7. CakePHP — Views ................................................................................................................................... 29 View Templates ............................................................................................................................................. 29 View Variables ............................................................................................................................................... 29 8. CakePHP — Extending Views .................................................................................................................. 32 9. CakePHP ― View Elements ..................................................................................................................... 34 10. CakePHP ― View Events ......................................................................................................................... 36 11. CakePHP — Working with Database ....................................................................................................... 37 Insert a Record .............................................................................................................................................. 39 12. CakePHP ─ View a Record ....................................................................................................................... 42 13. CakePHP — Update a Record .................................................................................................................. 45 14. CakePHP ― Delete a Record ................................................................................................................... 49 15. CakePHP — Services ............................................................................................................................... 53 Authentication ............................................................................................................................................... 53 16. CakePHP — Errors & Exception Handling ................................................................................................ 58 Errors and Exception Configuration .............................................................................................................. 58 17. CakePHP — Logging ................................................................................................................................ 61 Logging Configuration ................................................................................................................................... 61 Writing to Log file .......................................................................................................................................... 62 18. CakePHP — Form Handling ..................................................................................................................... 65 19. CakePHP — Internationalization ............................................................................................................. 71 Email .............................................................................................................................................................. 74 20. CakePHP — Session Management ..........................................................................................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages120 Page
-
File Size-