title: How can I use base_path() inside a view in Drupal?
body: <p>I have the following fields inside a view:</p>
  
  <ol>
  <li>User ID</li>
  <li><p>Teaser</p>
  
  <ul>
  <li>I selected "<em>exclude from display</em>" for the <strong>User ID</strong> field. </li>
  <li>In the <strong>Teaser</strong> field, I selected the "<em>rewrite the output of this field</em>" option. This way, I can use html to completely control the structure of the view's output. Moreover, I can call the User ID field by using it's token, <strong>[uid]</strong>.</li>
  </ul></li>
  </ol>
  
  <p>For example, I can do the following in the teaser's rewrite:</p>
  
  <blockquote>
  <pre><code>&lt;a href="user/[uid]" title="Visit this user's profile"&gt;Visit Profile&lt;/a&gt;
  </code></pre>
  </blockquote>
  
  <p>The problem with the above code is that the path is relative. It will only work on the front page of the site. </p>
  
  <p>For example, if this link is clicked in </p>
  
  <blockquote>
    <p>www.example.com/node/1</p>
  </blockquote>
  
  <p>then it will visit a non-existent URL of: </p>
  
  <blockquote>
    <p>node/1/user/[uid]</p>
  </blockquote>
  
  <p>I have tried the following: <a href="http://chopapp.com/#o7osql65" rel="nofollow">http://chopapp.com/#o7osql65</a></p>
  
  <p>But views fields does not allow PHP codes.</p>
  
  <p>I might be approaching this entirely wrong. Does anyone have any suggestions? Thanks.</p>