title: How to pass a php variable to a twig template
body: <p>I am using twig for the first time and I want to pass a variable to the template, So How I can pass a new template variable?
  I want to add something like : </p>
  
  <pre><code>{{ Total_project }}
  </code></pre>
  
  <p>This variable is a return for a function that count the projects and return the total:</p>
  
  <pre><code>public function total_projects(){
          if ($result = mysqli_query($conn, "SELECT project_id as total_project FROM Projects")) {
              $row_cnt = mysqli_num_rows($result);
              }
      }
  </code></pre>
  
  <p>What shall I do exactly?</p>