Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

moved upgrading hints and expanded them

  • Loading branch information...
commit b240acc6ead61920611e198ce86b80bb10f20323 1 parent 19955a7
@lsmith77 lsmith77 authored
Showing with 48 additions and 13 deletions.
  1. +0 −13 README.md
  2. +48 −0 UPGRADING.md
View
13 README.md
@@ -742,19 +742,6 @@ With this configuration, route name would become:
Say NO to name collisions!
-### Upgrading
-
-If you are upgrading from an older version, please note that:
- * You must change sensio_framework_extra setting.
- Correct configuration:
-
- sensio_framework_extra:
- view: { annotations: true }
-
- * The ViewInterface is gone so you might have to change your controller config if you refer to the fos_rest.view service.
-
-
-
Full default configuration
==========================
View
48 UPGRADING.md
@@ -0,0 +1,48 @@
+Upgrading
+=========
+
+Note as FOSRestBundle is not yet declared stable, this document will only be updated
+for major refactorings.
+
+### upgrading from 0.5.0_old_serializer
+
+ * In case you are using th SensioFrameworkExtra integration you must change
+ sensio_framework_extra setting:
+
+ sensio_framework_extra:
+ view: { annotations: true }
+
+ * The ViewInterface is gone so you might have to change your controller config if you refer to the fos_rest.view service.
+
+ * The View class is now split into a View (simple data container) and a ViewHandler (contains the actual rendering logic).
+
+ The following code would need to be changed:
+
+ public function indexAction($name = null)
+ {
+ $view = $this->container->get('fos_rest.view');
+
+ if (!$name) {
+ $view->setResourceRoute('_welcome');
+ } else {
+ $view->setParameters(array('name' => $name));
+ $view->setTemplate(new TemplateReference('LiipHelloBundle', 'Hello', 'index'));
+ }
+
+ return $view->handle();
+ }
+
+ To the following code:
+
+ public function indexAction($name = null)
+ {
+ if (!$name) {
+ $view = RouteRedirectView::create('_welcome');
+ } else {
+ $view = View::Create(array('name' => $name))
@stof Owner
stof added a note

you should add the use statements for these classes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ ->setTemplate(new TemplateReference('LiipHelloBundle', 'Hello', 'index'));
+ ;
+ }
+
+ return $this->container->get('fos_rest.view_handler')->handle($view);
+ }
Please sign in to comment.
Something went wrong with that request. Please try again.