You are on page 1of 3

routing prefix in croogo

requestAction(string $url, array $options)

This function calls a controller's action from any location and returns data from the action. The $url passed is a CakePHP-relative URL (/controllername/actionname/params). To pass extra data to the receiving controller action add to the $options array. When migrating to cakephp2.0, how will the following file names may change?

my_first_controller.php fort.php (a Helper) mess.php (a Component)

Answer is,

MyFirstController.php FortHelper.php MessComponent.php

What are commonly used components of cakephp?


* Security * Sessions * Access control lists * Emails * Cookies * Authentication * Request handling

what is habtm. Me : has and belongs to many is a kind of associations that can be defined in models for retrieving associated data across different entities.

: how can we use ajax in cakephp. Me : by calling ajax helper and then using it in controller for rendering. http://book.cakephp.org/1.3/view/991/requestAction

disableCache
Cache-Control: no-store, no-cache, must-revalidate Cache-Control: post-check=0, pre-check=0 Pragma: no-cache

postConditions
http://book.cakephp.org/1.3/en/view/989/postConditions

Callbacks
beforeFilter() beforeRender()

utilites libraries : App,inflector,stirng,xml,Set,Security,cache,Httpsocket,router

Behavior callbacks beforevalidate,beforeFind,afterFind,beforeSave,beforeDelete

Wat is pr(print_r) som global constants Wat is fun to convert str into lower letters in cakephp ans:low()

7. What if I need to work with more than one table simultaneously? By default, a NotesController will try to locate and load a Note model class. If your controller needs to access more than its default model, you can define additional models by setting the $uses array, like this: var $uses = array(Note, AnotherModel, YetAnotherModel); In some cases, two or more tables might be closely related and would therefore be used with JOIN statements: your notes may have been submitted by different people listed in an authors table, for example. In these cases, CakePHPs Associations can be used to define complex table relationships directly in your Model class. Is there any way to include my custom function/class in Cake? Sure there is. If you want to use a custom external class, you can put it in the /vendors/ directory and load it into your controller like this: vendors(MyClassName);

If you need to define custom application-wide constants or functions, you can place them in /app/config/bootstrap.php, which will make them available everywhere in your application. You can adapt your code and create a helper or a component to be used in conjunction with views or controllers.
http://allphptips.wordpress.com/category/tutorials/cake-php/

Changes in disabling components

In the past you were able to disable components via $this->Auth->enabled = false; for example. In CakePHP 2.0 you should use the ComponentCollections disable method, $this->Components>disable(Auth);. Using the enabled property will not work
SecurityComponent

SecurityComponent no longer handles Basic and Digest Authentication. These are both handled by the new AuthComponent. The following methods have been removed from SecurityComponent:

requireLogin() generateDigestResponseHash() loginCredentials() loginRequest() parseDigestAuthData()

You might also like