Home Backend Development PHP Tutorial Cakephp 3.x (Preface-Why use frameworks)

Cakephp 3.x (Preface-Why use frameworks)

Nov 09, 2016 am 11:50 AM
cakephp

I took a Web Engineer course when I was a graduate student. The course at that time was java servlet + Tomcat + Mysql to develop a social networking site similar to Facebook. The teacher who gave the lecture mentioned the framework and said that the purpose of the framework is to reduce the time of early rotation. The cost of learning the framework is to read the Documentation, which usually takes a month to learn and explore. But I don’t think so. Building blocks with your bare hands is cool and awesome.

I really came into contact with the framework in early 2015, when I just started working. At that time, I used Cakephp, a framework I heard during my internship at NXP. Cake's early idea was to inherit RoR (Ruby on Rails) 100%, such as migration and command line. Of course, what is criticized is Cake's data encapsulation model, which favors relational databases. Although Cakephp may not be as well-known as Lavare, there are still many questions from the core developers, community activity, and Q&A community.

For those who are new to website building, Cakephp is very efficient in development and easy to expand. And for children who are inspired to become architects, I personally think the learning value of reading Cakephp core code is very high. In the early stage, through the use of the API encapsulated by Cakephp, you can understand the basic modules and functions of the ordinary MVC framework. In the process of advanced, read the core code to understand the design principles. Finally, by optimizing the code, it reaches the point of integration. As a fledgling phper, the author is also groping and working hard in development. I hope to provide my thoughts and ideas to everyone who can read this article and make progress together with you.

This series mainly focuses on translating Cakephp 3 Cookbook, focusing on the experience of using Cakephp 3 in the development project process, while interspersed with introducing the characteristics of Cakephp 3. I hope to make some small contributions to Cakephp by introducing and translating Cakephp 3. I also hope to meet like-minded friends through this series.

Before getting into the details, let’s quickly talk about some of the functions of Cakephp 3.

1). Naming Conventions
Cake, like RoR, Django and other frameworks, provides a complete set of MVC convention names. Using naming conventions, you can conveniently use some of the functions provided by Cake. It is also helpful for code maintenance after the project. For the development process, naming conventions contribute to development efficiency.

2). Data layer (Model)
Compared with Cakephp 2, the data layer of Cakephp 3 has been significantly improved. Not only does it support MYSQL, PostgreSQL, Microsoft SQL Server, SQLite, etc., but the ORM also provides two different data CRUD APIs. Users can use native SQL statements to call the database and process queries flexibly. The Entity processing class provides a set of encapsulated APIs that can be used to safely process data.

3). Views
The view layer provides basic data presentation. Templates and extension modules efficiently simplify code, making front-end code more concise and reusable. At the same time, the view layer provides a complete RESTFUL application, including XML, JSON and other resources, which can provide a web server for the website in the form of URI.

4). Control layer (Controllers)
As the core logic layer, the control layer effectively combines the data layer and the view layer. Important algorithm processing can be implemented and improved at this layer.

Cakephp 3.x (Preface-Why use frameworks)

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

CakePHP Working with Database CakePHP Working with Database Sep 10, 2024 pm 05:25 PM

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

How to use the database query builder in CakePHP? How to use the database query builder in CakePHP? Jun 04, 2023 am 09:02 AM

CakePHP is an open source PHPMVC framework which is widely used in web application development. CakePHP has many features and tools, including a powerful database query builder for interactive performance databases. This query builder allows you to execute SQL queries using object-oriented syntax without having to write cumbersome SQL statements. This article will introduce how to use the database query builder in CakePHP. Establishing a database connection Before using the database query builder, you first need to create a database connection in Ca

How to create custom pagination in CakePHP? How to create custom pagination in CakePHP? Jun 04, 2023 am 08:32 AM

CakePHP is a powerful PHP framework that provides developers with many useful tools and features. One of them is pagination, which helps us divide large amounts of data into several pages, making browsing and manipulation easier. By default, CakePHP provides some basic pagination methods, but sometimes you may need to create some custom pagination methods. This article will show you how to create custom pagination in CakePHP. Step 1: Create a custom pagination class First, we need to create a custom pagination class. this

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

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 gu

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

In this chapter, we are going to learn the following topics related to routing ?

See all articles