cakePHP

CAKEPHP: PHP FRAMEWORK

0  0 2016-11-12 11:04:05

Cake php is open source php framework used for web development. It is well structured framework for programmers inspired from the well known framework Ruby on Rails.

Reason for choosing cake php
1. User friendly community
2. Freely available
3. Compatible with PHP versions 4 and 5
4. Facility of integrated CRUD for database communication and simplified queries
5. Facility of Application Scaffolding
6. Supports Model View Controller Architechture
7. Facility of Built in validation
8. Availability of Access control lists.
9. More secure session and request handling components
10.Works with site subdirectory with or without Apache configuration

History: Michal Tatarynowicz in 2005, invented Rapid Application Framework based on PHP. The framework is licenced under MIT. It is firstly pronounced with Cake only. Now it is pronounced as CakePHP.

Basic Concepts:
The cakePHP is basically based on Model View Controller Structure. The main concept of Model View Controller Architecture is separate your code into simplified manner so that it is very neat and clean.
In definition of CakePHP model describes a database table/record, its relationships to other tables. Also it contaions validation rules for forms used in project. By default, each model uses the table who’s name is plural of its own, i.e. a ‘User’ model uses the ‘users’ table. Models can also contain data validation rules, association information, and methods specific to the table it uses. Here’s what a simple User model might look like in Cake:
The view is nothing but the HTML files embedded with PHP code. The view takes help of model and  uses Models to read and write data to and from databases and other sources, and lastly, sends output data to the appropriate view file. The HTML helper is available in every view by default, and is by far the most commonly used helper in views. It is very helpful in creating forms, including scripts and media, linking and aiding in data validation. Please see section 1 in Chapter “Helpers” for a discussion on the HTML helper.

The controller in cakePHP handles all the requests from server. Most commonly, controllers are used to manage the logic for a single model. Your application’s controllers are classes that extend the Cake AppController class, which in turn extends a core Controller class. Controllers can include any number of actions: functions used in your web application to display views.

CakePHP file structure:
When you open cakePHP folder structure you will mainly see 3 Folders
1.App
2.cake
3. vendors

App Folder-> The app folder contains application specific folders and files. As App folder is separate it is easy to update CakePHP.
Vendor Folder-> Vendor Folder is used to store external library or third party library files inside it.
You can access classes with help of vendor() function.

Comments (0)

Post Your Comments

Headquarter



Hong Kong Office



Find Us On

Ziuby
Ziuby