Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function lowercaseAction()
- {
- $format = $this->getRequest()->getParam('format', 'xml');
- $word = $this->getRequest()->getParam('word', 'Hello');
- switch ($format) {
- case 'json':
- $this->_helper->viewRenderer()->setNoRender(true);
- $this->_helper->json(array ('word' => $word));
- break;
- case 'xml':
- default:
- $this->getResponse()->setHeader('Content-type', 'text/xml');
- $xmlstr = '<word>' . $word . '</word>';
- $xml = new SimpleXMLElement($xmlstr);
- $this->view->xml = $xml->asXML();
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement