CakePHP docs
| Id/Actions | Category | Code Examples | Links | Remarks |
|---|---|---|---|---|
| 38 View |
12 types of helpers in Cake | Cake comes preinstalled with 12 helpers: • Ajax • Cache • Form • HTML • JavaScript • Number • Paginator • RSS • Session • Text • Time • XML |
http://bakery.cakephp.org | |
| 40 View |
3 Basic User <-> CakePHP application interactions | Users will most often interact with your Cake application in one of three ways: 1) by making a simple page request; 2) by submitting a form of some kind; 3) or by sending page or form requests asynchronously (also described as Ajax processes). |
||
| 79 View |
8 Built-in Components | AclComponent AuthComponent CookieComponent EmailComponent PaginatorComponent RequestHandlerComponent SecurityComponent SessionComponent |
||
| 2 View |
A menu item for CakePHP? | |||
| 69 View |
Ajax helpers | Not only can the Ajax helper simplify using Prototype, but it can also make animation effects easier to use. |
||
| 34 View |
Asynchronous Sequence - AJAX | Most developers refer to any asynchronous server responses as Ajax operations, even though Ajax started as an acronym meaning Asynchronous JavaScript And XML. |
||
| 15 View |
Behaviors | => When interacting with the database, sometimes the model will
need to perform more complex processes than simply CRUD
functionality. In some applications, deleting a record will require
performing other manipulations to other tables and records,
and so on, with other database operations. Cake resolves this issue
with behaviors, which are classes that may be called by models when
performing model functions.
=> Behaviors are stored in the app/models/behaviors directory and
can be named anything following the same rules for naming helper
files and components. They must have the .php extension.
=> In the file, behavior class names are set with the following
syntax:
class SpecialBehavior extends ModelBehavior {}
=> By using behaviors to store complex or customized model
operations, you give the application's models more consistency. |
||
| 43 View |
CakePHP functions - afterFilter() - a controller function | Just like the beforeFilter() callback action, afterFilter() performs logic after every action is called. |
||
| 42 View |
CakePHP functions - beforeFilter() - a controller function | The beforeFilter() callback action is called before every action is
executed. It is entered like any other action, as a PHP function, and
interrupts processing controller logic in the requested action. To block
users from accessing a certain area of the site, the beforeFilter() action
can check the session for information.
Example:
function beforeFilter() {
if ($this->action == 'view') {
if (!$this->Session->check('User')) {
$this->redirect('/users/login');
}
}
} |
||
| 44 View |
CakePHP functions - beforeRender() - a controller function | This callback action performs logic between the execution of the requested action's logic and the rendering of the view output for all actions. Like beforeFilter() and afterFilter(), beforeRender() can be made to apply to a specific action by using the $this->action variable. |
||
| 50 View |
CakePHP functions - bindModel() model function | The bindModel() allows you to assign associations as well.
Example:
$this->bindModel(
array('hasManyAndBelongsToMany'=>array('Tag'))
); |
||
| 29 View |
CakePHP functions - compact | This is php function:
example:
<?php
$city = "San Francisco";
$state = "CA";
$event = "SIGGRAPH";
$location_vars = array("city", "state");
$result = compact("event", "nothing_here", $location_vars);
print_r($result);
?>
What does the compact() function do? It takes the array you pass into
it and looks for variables of the same name as the elements in that
array. It then spits out an array of key => value pairs. So, one little
trick with compact() means you only have to use one set statement.
This works because all those $this->set() statements simply add
those values to an array. |
||
| 26 View |
CakePHP functions - create - a model function | In controller: $this->Post->create(); Cake performs saves through the use of the create() and save() model functions. => Initializes the model for writing a new record, loading the default values for those fields that are not defined in $data, and clearing previous validation errors. Especially helpful for saving data in loops. => Rendering <form> tags is simplified by the $form->create() function. This function also manages the action HTML attribute and points the form to the correct model. create( model[string], options[array] ) |
||
| 35 View |
CakePHP functions - debug() function | Cake's debug() function provides a detailed and nicely formatted view of a specified array. In this view file, insert the following line, which uses the debug() function: <?php debug($post);?> |
||
| 31 View |
CakePHP functions - del | In controller: $this->Post->del($id); // delete in posts table a row with id = $id. |
Page 1 of 6, showing 15 records out of 79 total, starting on record 1, ending on 15
