CakePHP 3 is a PHP MVC framework designed to help you rapidly build web applications. Through this video, Justin Yost provides an overview of the CakePHP framework. CakePHP can generate clean urls, validate and sanitize user input, and prevent common security issues. CakepPHP is an MIT-licensed framework that can work with MySQL, PostgreSQL, SQLServer, or SQLite databases.
- View Offline
- [Voiceover] Let's give a brief overview of CakePHP before we start using it. CakePHP is a PHP, object-oriented, Model-View-Controller framework, designed around providing the tooling to let you rapidly build web applications. CakePHP focuses on solving problems rapidly, by using conventions over configuration, to enable you to work sooner, without making a lot of decisions upfront. First, what is a framework? Frameworks are simply a common set of tools and patterns for approaching groups of problems.
What problems does CakePHP focus on solving for you? CakePHP is best at building web applications using relational databases, for example, MySQL. CakePHP is a highly opinionated framework that tries to make lots of decisions ahead of time for you, so you spend less time worrying about configuration, or how to name classes and tables, and focus on the problem of building your application. CakePHP requires PHP 5.4.16 or greater to work for versions 3.0 through 3.1.
The current latest version of CakePHP, 3.2, requires PHP 5.5.9. This takes advantage of many of the latest improvements in PHP, including features such as traits and generators. Don't be worried if you aren't familiar with either of those features of PHP. We won't be using them. CakePHP uses these later versions of PHP to enable higher levels of modularity in your code and in the framework. This enables you to quickly solve problems that CakePHP has already solved, with very little code of your own to write.
CakePHP, however, also provides tooling for you to replace entire layers of the framework if you want to approach a problem in a different manner. You can use as little or as much of the framework as you need. CakePHP approaches problems using the Model-View-Controller pattern. We'll explore this much more in depth, but for now, understand that this pattern is designed to separate the data, and that's the model; from the presentation, that's the view layer; from the part that processes user input, or the controller.
CakePHP is an open-source, MIT licensed framework. There is an active group of core developers who help manage and improve the framework. The project is developed in open, and you can find more information about contributing or getting help with the framework at the official CakePHP site, cakephp.org. Included on this site is the official documentation for CakePHP that I'll refer to as the book, at book.cakephp.org.
CakePHP is a critical framework for PHP developers. It helps them build complex web applications faster and more efficiently. If you want to use CakePHP 3 (the latest version of the framework) in your own development workflow, this is the place to start.
Justin Yost provides an overview of the underlying MVC pattern in CakePHP, and the installation and configuration process for Mac and Windows. He shows how to use the CakePHP shell to build your first basic CakePHP app, and then discusses each application element in depth: controllers, models, views, components, behaviors, helpers, and utilities. At each step, he discusses the relevant new features and enhancements in CakePHP 3, including new components; performance, session management, and ORM improvements; and localization.
In later chapters, the course gets a little more advanced. Watch these tutorials to learn how to send email with CakePHP, extend CakePHP with plugins, and write unit tests to identify and eliminate bugs in your code. Justin also shows how to add security to your CakePHP apps with a basic user authentication system.
- Installing and configuring CakePHP
- Using the CakePHP shell console
- Creating CakePHP controllers
- Saving data in a CakePHP model
- Finding and deleting data
- Working with entity methods
- Creating CakePHP views
- Using and customizing components to share functionality between controllers
- Creating behaviors
- Formatting data with helpers
- Developing faster with CakePHP utilities: hash, collections, and logging
- Sending CakePHP email
- Creating a custom plugin
- Testing CakePHP applications
- Authorizing users of CakePHP applications