In a Views template, how can I mimic the effect of "Link this field to its taxonomy term page"? I have a view of taxonomy terms that displays Fields, including Taxonomy term: name and Taxonomy term: Term ID.

I am attempting to use a views template to customize the output of this view.

In the Views UI, if I click Taxonomy term: name, I can get an option to Link this field to its taxonomy term page.

I would like to use the link generated by this option in my views template output.

However, when I dpm($row), only the term name and term ID are returned.  How does Views create the link to the taxonomy term, and how can I mimic this in my template file?
One easy-ish way to do that within the Views UI is with the option:

"Rewrite the output of this field"


Add term id field Check "Exclude from display" 
Order the field so it's above the other fields 
Edit the field you want to convert into a link 
Check "Rewrite the output of this field"


e.g 

&lt;a href="/taxonomy/term/[tid]"&gt;[name]&lt;/a&gt;


to create a link.

You can also add a global "Custom text" to add arbitrary text using the replacement tokens there as well.

In that way, tokens from your view fields can be made available as replacement pattern options in your View.