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 :
{{ Total_project }}
This variable is a return for a function that count the projects and return the total:
public function total_projects(){
if ($result = mysqli_query($conn, "SELECT project_id as total_project FROM Projects")) {
$row_cnt = mysqli_num_rows($result);
}
}
What shall I do exactly?