render php code in view result What's the proper method to render a field within the views?

In node templates I render php code using

echo render($content['fancy_field']); 


But when I want to render php code within a view I was using

echo render($view-&gt;result-&gt;_field_data['nid']['entity']-&gt;fancy_field);


But it didn't works, any ideas?
Best practice is to implement hook_field_formatter_info() and hook_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display). The examples module shows how to do this in greater detail in the field_example submodule.