Sunday, 27 December 2015

Framework

Download CakePHP

INTRODUCTION OF CAKE-PHP
CakePHP is an open source web application framework. It follows the “Model-View-Controller” (MVC) approach and is written in PHP, modeled after the concepts of Ruby on Rails, and distributed under the MIT License.

CakePHP started in April 2005, when a Polish programmer “Michal Tatarynowicz” wrote a minimal version of a Rapid Application Framework in PHP and named it Cake. He published the framework under the MIT license, and opened it up to the online community of developers. In December 2005 after it, 
L. Masters and G. J. Woodworth founded the Cake Software Foundation to promote development related to CakePHP. Version 1.0 was released on May 2006.

Ruby on Rails, or simply Rails, is a web application framework written in Ruby under MIT License. Rails is a Model–view–controller (MVC) framework, providing default structures for a database, a web service, and web pages.

Note: The MIT License is a free software license originating at the “Massachusetts Institute of Technology” (MIT). It is a permissive free software license, meaning that it permits reuse within proprietary software provided all copies of the licensed software include a copy of the MIT License terms and the copyright notice.

      Features of Cake-PHP
  • Free Open-Source MIT License allowing you to use CakePHP applications within any of your own projects.
  • Compatibility with both PHP4 and PHP5. The minimum version needed is 4.3.2.
  • Support for MySQL, PostgreSQL SQLite, PEAR-DB and wrappers for ADODB, a database abstraction library.
  • Model-View-Controller layout.
  • Easy CRUD (Create, Read, Update and Delete) database interaction.
  • Search Engine Friendly URLS.
  • Input validation and sanitization tools to make your applications much more secure.
  • Templating with familiar PHP syntax.
  • Caching Operations.
  • The cake folder stores all the core functions and internals for CakePHP. You will usually not need to edit anything here.
  • The docs folder contains very little, but does hold the license information (COPYING.txt), a change log and some other useful files. This directory is not important for CakePHP to run so you can remove it if you wish.
  • The app folder is where your application code will go. The app folder will hold your controllers, configuration, templates and much more.
       Cake PHP (Directory Structure)
o    The config folder contains all the configuration files for the application. This includes
database details, access list, inflections and routes (URL rewriting).
o    The models folder stores all the sql database functionality for your application.
o    The views folder stores all the templates, layouts (header, footer) and helper modules that
assist functionality (such as AJAX).
o    The controllers folder stores all the controllers for your application. A controller is the part
of the application that directs and controls the model and the views by accepting input and
deciding what to do with it.
o    The plugins folder stores plugins which are a combination of models, views and controllers
that can be packaged and used in other applications. Examples are user management modules
or an RSS module.
o    The tmp folder stores cache files generated by the caching system and also stores debugging
logs. This folder will be very valuable during development.
o    The vendors folder, can contain other libraries that you want to include in a particular
application.
o    The webroot folder stores static media such as CSS, images and the JavaScript needed by
your application.


 Model View Controller (MVC)
MVC approach can be divide in three parts
  • Model (Data)
  • View (An interface to view and modify the data)
  • (Controller) Operations that can be performed on the data
The MVC pattern, in a nutshell, is this:
1. The model represents the data, and does nothing else. The model does NOT depend on the controller or the view.

2.  The view displays the model data, and sends user actions (e.g. button clicks) to the controller. The view can:
o   be independent of both the model and the controller; or
o   actually be the controller, and therefore depend on the model.

3. The controller provides model data to the view, and interprets user actions such as button clicks. The controller depends on the view and the model. In some cases, the controller and the view are the same object.


Steps to download and install CakePHP
1. Download zip file for CakePHP from www.cakephp.org
2. Extract file and copy it in htdocs folder.
3. Run the “CakePHP” by localhost server
4. Create a database for your CakePHP
5. Now change setting in config directory under in C:/XAMPP/htdocs/cakephp/app/config
6. Change name “database.php.default” file name in “database.php”
7. Open the “database.php” file
8. Change login to “root”, password to “blank” and database “cake” under (public $default = array)
9. Now change the default security salt
10. Open “Core.php” file  and find “Security.salt”
11. Replace default “Security.salt” value to “nowthisismyawesomesaltthatnoonecaneverknowxfs2gu” and change “Security.cipherSeed” value to “122333444455555”

Now to edit the cake php page
To change the content of this page, edit: APP/View/Pages/home.ctp.
To change its layout, edit: APP/View/Layouts/default.ctp.
You can also add some CSS styles for your pages at: APP/webroot/css.

A brief detail about .ctp file
.ctp is the view file extention of CakePHP template file. It stands for "CakePHP Template". It is a template file used by CakePHP. Basically it is a application View layer, it contains the PHP,Html "view" code to display the end user.

No comments:

Post a Comment