CakePHP 1.1 & 1.2 Manual

CakePHP has released the 1.1 Collection Manual is available now. To know more follow the link,

http://book.cakephp.org/view/305/The-Manual

Advertisements

Customize webroot folder

In CakePHP  managing more than web site in the one webroot is can done by rewritng the URL in the .htaccess file located in the Webroot folder of CakePHP.

For example, i have the website application  say ‘forum’ folder and its located in my cakephp webroot folder on the existing site. By doing this update the .htaccess file.

RewriteRule    ^forum – [L]

CakePHP: URL Rewriting

What is Mod_Rewrite?

Simply put, mod_rewrite is an Apache module that let’s you rewrite urls based on rules you define.

Some other common uses for mod_rewrite: 
  • Directing all traffic from multiple domain names to one domain
  • Directing all traffic from www and non-www to one location
  • Blocking traffic from specific websites
  • Blocking spammy searchbots and offline browsers from spidering your site and eating your bandwidth
  • Mask file extensions
  • Preventing image hotlinking (other web pages linking to images on your server)

Cake PHP URLs can be made SEO friendly by using the overwrite rule and modifying the htacess file of the root folder as shown below:

The below example of URL Rewrites for the site has n level menus, 

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule ^([^/]+html)$ app/webroot/controller_name/function_name/$1 [L]
   RewriteRule ^[^/]+/([^/]+html)$ app/webroot/controller_name/function_name/$1 [L]
   RewriteRule ^[^/]+/[^/]+/([^/]+html)$ app/webroot/controller_name/function_name/$1 [L]
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>
 
Note:
Running URL Rewrite sucessfully, we need to enable the mod_rewrite.so in the httd.conf of Apache Server.
 
 LoadModule rewrite_module modules/mod_rewrite.so

CakePHP: Introduction

CakePHP is an open source web application framework for producing web applications written in PHP. It is written in PHP, modeled after the concepts of Ruby on Rails, and distributed under the MIT License.
CakePHP started in 2005, when Ruby on Rails was gaining popularity. The community has since grown and spawned several sub-projects. CakePHP is not a port of Ruby on Rails to PHP, but appropriates many of its useful concepts.

Features of CakePHP

Like Rails, CakePHP makes it easier for the user to interface with the database with active records. It also encourages use of the model-view-controller architectural pattern.

  • Compatible with PHP4 and PHP5
  • Integrated CRUD for database and simplified querying
  • Request dispatcher with custom URLs
  • Templating (PHP syntax with helper methods)
  • View helpers for AJAX, Javascript, HTML forms
  • Website directory independent
  • Built-in validation
  • Access control lists (ACL)
  • Application scaffolding[3]
  • Data sanitization
  • Security, session, and request handling components
  • View caching
  • Unit testing using the SimpleTest framework, available in CakePHP version 1.2

Console Applications

CakePHP offers a CLI, or Command-line interface, accessed by the “cake” command. There are three core console applications available in the library: “bake” for the generation of models, controllers and views; “acl” for the management of Access Control Lists; and “schema” for database schema creation and migration.

Developers can also create their own “shells” and shared functionality across these shells called “tasks” (in CakePHP’s parlance). The scripts have access to the application’s models and controllers. An example use-case for this would be the scheduled update of the application’s data from an RSS or other data feed, with the full power of the application logic and data relationships created with CakePHP.

Model-View-Controller

CakePHP adheres to the MVC (Model-view-controller) architectural pattern separating code logic from the user interface. In MVC, the model represents the information (the data) of the application; the view corresponds to elements of the user interface such as text, checkbox items, and so forth; and the controller manages the communication of data and the business rules used to manipulate the data to and from the model.

More Detail on CakePHP and current Version can be downloaded from the following URL,

http://cakephp.org/


http://cakephp.org/downloads/nightly/1.2.x.x

cakephp

 

Know more about Cake PHP  follow the below link,
http://book.cakephp.org/