add link programmatically to views field Drupal 7
Instead of coding why you don't use views fields.


Add the title and node id fields to the view.
Exclude them from display.
Add a global: custom text field.
Use tokens to print the HTML you want.


It should look like this:

&lt;a href="/node/[nid]"&gt;[title]&lt;/a&gt;