About

Breaking

Wednesday 24 May 2017

how to create index in cakephp






ये  कोड  हम  इंडेक्स.क्तप जो  हम बनेय  गे  ये  टेबल  में  जो  डाटा   हम  save  करे  गे  वो  इसमें  दिखाई  देगा 

These codes will be visible in the index which we will create in the tables we save.
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