You can parse JSON data perfectly fine in a view, and there is no need to do it in a controller.
Just pass your JSON string to the view like you normally do with data you are going to show.
In your controller:
PHP Code:
<?php
$tennisArray = array('Djokovic' => 1, 'Federer' => 2, 'Nadal' => 3, 'Murray' => 4);
$data['tennisPlayers'] = json_encode($tennisArray);
$this->load->view("some_page", $data);
?>
In your view:
PHP Code:
<?php
echo $tennisplayers; //your JSON encoded string
?>
Which is similar to:
PHP Code:
<?php
echo {"Djokovic":1,"Federer":2,"Nadal":3,"Murray":4};
?>
You can use this with AJAX or a normal page request and use it as you like.
If you want to send back XML or a PDF, you have to use another header (not HTML) and you cannot simply echo it in a view.