Some features of CakePHP:
In article user settings CakePHP, Here I used CakePHP ver1.36 XAMPP webserver Mysql and Apache integration.System Requirements :
- Window or Linux Operating Systems
- MySQL database management system
Preparing to install: Download the latest version of CakePHP (1.3.6 stable) from:
http://github.com/cakephp/cakephp/archives/1.3 - Extract, for the directory of the web server - in this example angle webser my folder is: C: // xampp / htdocs - So we have structured as follows: C: // xampp / htdocs / cakephp
Installing CakePHP success: - Chmod directory app / tmp into 0777 (if on the host, but it was not necessary localhost) - Open a pp / config / core.php - Change the value of the line Configure :: write (' Security.salt ',' DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi2010 '); - Change the value of the line Configure :: write ('Security.cipherSeed', '768593096574535424967496836452011'); - Creating the database with name: cake_test - Open app / config / database.php , filled as follows:
var $default = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'root',
'password' => 'my_password',
'database' => cakephp_test',
'prefix' => '',
You need to change the entry in bold to suit the configuration on your machine.
The directory structure CakePHP
After downloading and unpacking CakePHP, you can see the files and directories: - app : is where the source code of your application (section Sticky) - cake : the places where the sources of CakePHP. You should not edit the files in this folder if you do not understand them - vendors : contains 3rd party applications, catering for your application - plugins : contains the components for application expansion
CakePHP models operating under MVC model application divided into 3 main parts: • Model • View • Controller In this article help the reader understand the overall operation of MCV CakePHP model, in the following sections go into more detail on how to use CakePHP.
Examples of basic MVC pattern: We link http://abc.com/product/view/10
- User A click on one link of the form http://abc.com/products/view/10
- The browser will send the request to the server
- Department dispatcher Dispatcher (part of CakePHP) test elementproducts / view / 10 and send the request to the relevant controller
- Parameter # 1: I have controller product
- Parameter # 2: I can view
the action is the name of one of Controller product
will be called to perform certain actions 1 - 3rd parameter: it is one worth 10 , 3rd normal parameters have more or not, depending on the intended use, here I have parameter = 10 to see the product id = 10 Describe in words through the example above:
Why use MVC?
In http://abc.com/để address whether the product is id = 10
- Because it helps us to build applications quickly
- Ease of maintenance, modularisation
- MVC separation of application tasks into individual components, makes it easy to add new (or change) the features that do not affect other components.