I broke a site yesterday using views global php, even if it was working in the preview, so I'm a bit nervious about that php in database and I'm trying to implement the same thing with Views API.
Depending on the key value of a hidden field in the current display, I need to put a custom text. Something like (global php version) :
if( isset($data) && isset($data->field_field_statut_depart) ) { switch( $data->field_field_statut_depart[0]['raw']['value'] ) { case 1: $text = 'ABC'; break; case 2: $text = 'DEF'; break; //and so on } print $text; } I'm trying to build it with hook_views_pre_view(&$view, &$display_id, &$args) but I can't find the required field_statut_depart value in dpm($view).
Maybe it's not the right hook ?
EDIT : after applying solution described in the answers below (views_post_execute hook) and 12 hours running, I'm facing a strange behaviour : the changes made by views_post_execute hook are not stable : after clearing caches, they are visible for a while but raw data (without my function applied) is displayed then ! I'm afraid it's still not the right place to do that. Any help is welcome.