Skip to content

Commit

Permalink
moved upgrading hints and expanded them
Browse files Browse the repository at this point in the history
  • Loading branch information
lsmith77 committed Sep 6, 2011
1 parent 19955a7 commit b240acc
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 13 deletions.
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
==========================

Expand Down
48 changes: 48 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -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))

This comment has been minimized.

Copy link
@stof

stof Sep 6, 2011

Member

you should add the use statements for these classes

->setTemplate(new TemplateReference('LiipHelloBundle', 'Hello', 'index'));
;
}

return $this->container->get('fos_rest.view_handler')->handle($view);
}

0 comments on commit b240acc

Please sign in to comment.