Skip to content

Commit

Permalink
Moved rest controller xml basenode setting to rest config.
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdejonge committed Sep 24, 2012
1 parent 8fdbe96 commit 29bb430
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion classes/controller/rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ protected function response($data = array(), $http_status = null)
{
// Detect basenode
$xml_basenode = $this->xml_basenode;
$xml_basenode or $xml_basenode = \Config::get('format.xml.basenode', 'xml');
$xml_basenode or $xml_basenode = \Config::get('rest.xml_basenode', 'xml');

// Set the XML response
$this->response->body(\Format::forge($data)->{'to_'.$this->format}(null, null, $xml_basenode));
Expand Down
8 changes: 8 additions & 0 deletions config/rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
*/
'default_format' => 'xml',

/*
| XML Basenode name
|
| Default: xml
|
*/
'xml_basenode' => 'xml',

/*
| Name for the password protected REST API displayed on login dialogs
|
Expand Down

0 comments on commit 29bb430

Please sign in to comment.