Controller & Components
Controller
-
Controller::set()no longer changes variables from$var_nameto$varName. Variables always appear in the view exactly as you set them. -
Controller::set('title', $var)no longer sets$title_for_layoutwhen rendering the layout.$title_for_layoutis still populated by default. But if you want to customize it, use$this->set('title_for_layout', $var). -
Controller::$pageTitlehas been removed. Use$this->set('title_for_layout', $var);instead. - Controller has two new methods
startupProcessandshutdownProcess. These methods are responsible for handling the controller startup and shutdown processes.
Component
Component::triggerCallbackhas been added. It is a generic hook into the component callback process. It supplantsComponent::startup(),Component::shutdown()andComponent::beforeRender()as the preferred way to trigger callbacks.
CookieComponent
delis deprecated usedelete
AclComponent + DbAcl
Node reference checks done with paths are now less greedy and will no longer consume intermediary nodes when doing searches. In the past given the structure:
ROOT/
Users/
Users/
edit
ROOT/Users/Users/edit
The path ROOT/Users would match the last Users node instead of the first.
In 1.3, if you were expecting to get the last node you would need to use the path ROOT/Users/Users
RequestHandlerComponent
getReferreris deprecated usegetReferer
SessionComponent & SessionHelper
delis deprecated usedelete
SessionComponent::setFlash() second param used to
be used for setting the layout and accordingly rendered a layout
file. This has been modifed to use an element. If you specified
custom session flash layouts in your applications you will need to
make the following changes.
- Move the required layout files into app/views/elements
- Rename the $content_for_layout variable to $message
- Make sure you have
echo $session->flash();in your layout
SessionComponent and SessionHelper are not automatically loaded.Both SessionComponent and
SessionHelper are no longer automatically included
without you asking for them. SessionHelper and SessionComponent now
act like every other component and must be declared like any other
helper/component. You should update
AppController::$components and
AppController::$helpers to include these classes to
retain existing behavior.
var $components = array('Session', 'Auth', ...);
var $helpers = array('Session', 'Html', 'Form' ...);
var $components = array('Session', 'Auth', ...);var $helpers = array('Session', 'Html', 'Form' ...);
These change were done to make CakePHP more explicit and declarative in what classes you the application developer want to use. In the past there was no way to avoid loading the Session classes without modifying core files. Which is something we want you to be able to avoid. In addition Session classes were the only magical component and helper. This change helps unify and normalize behavior amongst all classes.


























