How do I alter the output of a field using a views handler Currently I'm uning Views PHP to reformat some fields in a view. in the documentation of views it says 


  While this module allows you to directly use PHP inside views which may be useful for quick and easy solutions, it is highly advisable to use regular handlers and plugins when available (or even to create one yourself).


In my particular use case, I'm trying to re-format the output of a field that is being loaded by relationship. How would I create a views handler, or a views plugin that does this?
You add your custom views handler using hook_views_data() like so:

function mymodule_views_data() {
  $data = array(
    ['my_table_name'] =&gt; array(
      'my_field_alias' =&gt; array(
        'real field' =&gt; 'my_field_id',
        'group' =&gt; t('Testing'),
        'title' =&gt; t('Testing'),
        'help' =&gt; t('Testing a thing.'),
        'field' =&gt; array(
          'handler' =&gt; 'my_custom_views_handler_test',
          'click sortable' =&gt; TRUE,
        ),
        'sort' =&gt; array(
          'handler' =&gt; 'views_handler_sort',
        ),
        'filter' =&gt; array(
          'handler' =&gt; 'views_handler_filter_string',
        ),
        'argument' =&gt; array(
          'handler' =&gt; 'views_handler_argument_string',
        ),
      ),
    ),
  );

return $data;
}


And then you declare your custom views handler:

class my_custom_views_handler_test extends views_handler_field {
  /**
   * Render some stuff.
   *
   * Data should be made XSS safe prior to calling this function.
   */
  function render($values) {
    $value = $this-&gt;get_value($values);
    return $this-&gt;sanitize_value($value);
  }
}


Almost all changes you'll be wanting to make should be made in an override of the render function.