About

Breaking

Tuesday 9 May 2017

how to create index in cakephp




INDEX.CTP

<h2>  users index </h2>
<table>
<tr>
<th>NAME</th>
<th>PASSWORD</th>
<th>FULL NAME</th>
</tr>
<?php foreach($users as $user): ?>

<tr>
<td> <?php echo  $user['User']['name']; ?> </td>
<td> <?php echo $user['User'] ['password'] ?> </td>
<td> <?php echo $user['User'] ['full_name'] ?> </td>
<?php endforeach; ?>
</table>





                      Controller 
          public function index(){
         $this->set('users', $this->User->find('all'));
           }





No comments:

Post a Comment