I Fetched the path field from view using views_pre_render(\Drupal\views\ViewExecutable $view) now I made some changes on that path field but I want path field use my data instead of drupal default path value how can I do that.
function view_path_views_pre_render(\Drupal\views\ViewExecutable $view) { if($view->id() == 'view_idea_shots_for_home_page' && $view->current_display == 'block_3') { foreach($view->result as $value){ $path = $view->field['path']->render($value); } $path = $path['#markup']; $path = get_tiny_url($path); kint($path); } } function get_tiny_url($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch,CURLOPT_URL,'http://tinyurl.com/api-create.php?url='.$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $data = curl_exec($ch); curl_close($ch); return $data; }
simply I want to alter path field data.