Hi
i cannot make a link on the field in result

<h2>View All Posts</h2>
<table>
    <tr>
        <th>Title</th>
        <th>Body</th>
    </tr>
    <?php 
    foreach($Posts as $post):?>
    <tr>
    <td><?php echo $Html->link($post['Post']['title'],array('action'=>'view',$post['Post']['id']));?></td>     
    <td><?php echo $post['Post']['body'];?></td> 
</tr>
<?php endforeach;?>
</table>

it is like link it is not acceptable
the error i get:
Error: Call to a member function link() on a non-object
File: C:\xampp\htdocs\cake\app\View\Posts\index.ctp
Line: 10
any help please

Try to remove ['Post'] from the variables, for example: $post['title'] instead of $post['Post']['title'].

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.