title: Ideal code to populate form fields in php
body: <p>I am learning PHP and looking for an ideal way to populate form fields.
  I have a class (Cl.tasks) which has the required methods. A Tasks.php page which views the data. and a tasks.js that runs jquery code for other related tasks.</p>
  
  <p>The form exists in tasks.php. So should i call the class in the field like this:</p>
  
  <pre><code>&lt;input type="text" class="form-control" name="task_name" value="&lt;?php $task= new task;  echo $task-&gt;listTaskDetail("accountname"); ?&gt;" placeholder="Task Name"&gt;
  </code></pre>
  
  <p>or is there an more ideal way to do this.</p>
  
  <p>Thank you</p>