From 48212aa84086b1cc6f00e914dfc94930e8f490f9 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Fri, 25 May 2012 10:08:09 +1200 Subject: [PATCH] MINOR Adding upgrade docs on deprecated Director::redirect() and Director::redirectBack() --- docs/en/changelogs/3.0.0.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/en/changelogs/3.0.0.md b/docs/en/changelogs/3.0.0.md index 1cd1a2f8c..ddfd3f0f1 100644 --- a/docs/en/changelogs/3.0.0.md +++ b/docs/en/changelogs/3.0.0.md @@ -52,6 +52,17 @@ Note the different options for the third parameter of `get()`: If you don't set an option, it will get all the values for the static, including inherited ones. This was previously known as `Object::combined_static()`. +### Director static functions deprecated, Director::redirect() and Director::redirectBack() in particular + +`Director::redirect()` and `Director::redirectBack()` are now marked as deprecated. + +If you have a `Controller` instance and need to redirect, call `redirect()` or `redirectBack()` on the instance +instead, e.g. `$controller->redirect()` or `$controller->redirectBack()`. Most of the time, form action handler +methods on a controller need only call `$this->redirect()` or `$this->redirectBack()`. + +Use `Controller::curr()->redirect()` and `Controller::curr()->redirectBack()` if you need to redirect in contexts +where a controller might not be immediately available. + ### DataExtension and deprecated extraStatics on extension classes {#extensions} `DataObjectDecorator` has been renamed to `DataExtension`. Any classes that extend `DataObjectDecorator`