Sunday, 29 September 2013

How do I pass a variable's value to html->link() $title?

How do I pass a variable's value to html->link() $title?

My code looks like this:
<li>
<?php echo $html-> link($post['Post']['title'],
array('action'=>'post', $post['Post']['id'])); ?>
</li>
I'm trying to get a link in the form of /cake/posts/view/<id>, where id is
1, 2, 3 etc.
The error Cake gives is
Error: Call to a member function link() on a non-object
Full code here: http://pastebin.com/hexVvkfk

No comments:

Post a Comment