CakePHP


What is CakePHP framework?
CakePHP is a free open-source PHP development framework for PHP, based on an MVC-like architecture that is powerful, but also easy to understand. The CakePHP framework represents a foundational structure for programmers to create web applications. Using it, the developers are enabled to work in a structured and rapid manner, without losing flexibility. A main benefit of CakePHP is the presence of an active developer team and a solid community of users.

CakePHP - an MVC-based framework
The CakePHP framework represents a robust base for handling every aspect of a web application, from the user's initial request to the final rendering of a web page. Following the principles of MVC (model, view, controller), the framework allows you to easily customize and extend most aspects of your application. It also offers a basic organizational structure, from filenames to database table names, keeping your entire application consistent and logical.

Beside Controllers, Models and Views, CakePHP features also Component, Behavior and Helper classes. We will try to explain the basic usage of the main components of the CakePHP framework in the examples below.

Controllers
The controllers contain the logic of the application. Each controller can offer different functionality, retrieve and modify data by accessing database tables through models, register variables and objects, which can be used in views. Most often, they are used to manage the logic for a single model. In CakePHP, there are file and classname conventions. Thus, the way you name your files matters. For example, the Product model would be handled by the ProductsController (note the plural form), the controller would bear the filename products_controller.php, whereas the model itself would be product.php. All these conventions can be changed, but using them makes your life a lot easier.

Your application's controllers are classes that extend the CakePHP AppController class, which itself extends the Controller class. The AppController class can be defined in /app/app_controller.php. It should contain methods that are shared between all of your application's controllers.

Controllers can include any number of methods which are usually referred to as actions. Actions are controller methods for displaying views. The dispatcher calls actions when an incoming request matches a URL to a controller's action. For example, the URL http://domain.com/CakePHP/forms/index will call the function 'index' in the FormsController on domain.com.

Link to the official website: http://cakephp.org

0
Your rating: None