Answers.Body: <p>They do the same thing. <code>url()</code> is an alias of <code>getUrl()</code>. This is the link from the Craft 2 docs: <a href="https://docs.craftcms.com/v2/templating/entrymodel.html#url" rel="nofollow noreferrer">https://docs.craftcms.com/v2/templating/entrymodel.html#url</a>.</p>
  <p>It works the same way in Craft 3, but I can never find anything in the Craft 3 docs.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-24T14:43:44.703Z
Answers.LastActivityDate: 2020-06-24T14:43:44.703Z
Answers.UserDisplayName: darylknight
Body: <p>What is the different between url() and getUrl()</p>
  <p>Ex:</p>
  <pre><code>   {% set solutionIcon = solution.solutionIcon.one() ?? null %}
     &lt;div class=&quot;img-wrapper mt--3 mb-2 mx-auto&quot;&gt;
        {% if solutionIcon %}
           &lt;img src=&quot;{{ solutionIcon.getUrl() }}&quot; alt=&quot;{{ solutionIcon.title }}&quot;&gt;
        {% endif %}
     &lt;/div&gt;
  
     {% set solutionIcon = solution.solutionIcon.one() ?? null %}
     &lt;div class=&quot;img-wrapper mt--3 mb-2 mx-auto&quot;&gt;
        {% if solutionIcon %}
           &lt;img src=&quot;{{ solutionIcon.url() }}&quot; alt=&quot;{{ solutionIcon.title }}&quot;&gt;
        {% endif %}
     &lt;/div&gt;
  </code></pre>
  
Tags: <url>
Title: What is the different between url() and getUrl()
ThreadText: # What is the different between url() and getUrl()
  
  (Asked by: username_0 on 2020-06-24)
  
  What is the different between url() and getUrl()
  
  Ex:
  
  ```
     {% set solutionIcon = solution.solutionIcon.one() ?? null %}
     <div class="img-wrapper mt--3 mb-2 mx-auto">
        {% if solutionIcon %}
           <img src="{{ solutionIcon.getUrl() }}" alt="{{ solutionIcon.title }}">
        {% endif %}
     </div>
  
     {% set solutionIcon = solution.solutionIcon.one() ?? null %}
     <div class="img-wrapper mt--3 mb-2 mx-auto">
        {% if solutionIcon %}
           <img src="{{ solutionIcon.url() }}" alt="{{ solutionIcon.title }}">
        {% endif %}
     </div>
  
  ```
  
  **Tags:** url
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-06-24. Score: 1
  
  They do the same thing. `url()` is an alias of `getUrl()`. This is the link from the Craft 2 docs: <https://docs.craftcms.com/v2/templating/entrymodel.html#url>.
  
  It works the same way in Craft 3, but I can never find anything in the Craft 3 docs.
  
  
  ---
  
  