Wednesday, October 31, 2012

Re: ajax link with unique ID

Why are you php tag inside php tag??

use it as-

<?php echo $ajax->link(ucfirst(__('accept', true)), array('controller' => 'friends', 'action' => 'accept', $friend['FriendRequest']['id']), array('update' => "friend_".$friend['FriendRequest']['id']));?>

On Wed, Oct 31, 2012 at 11:11 PM, Chris <chris69m@yahoo.com> wrote:

hi guys,... I'm having a problem placing unique ID in a ajax link 'update': 

'update' => 'friend_<?php echo $friend['FriendRequest']['id'] ?>' 

here is the link: 

<?php echo $ajax->link(ucfirst(__('accept', true)), array('controller' => 'friends', 'action' => 'accept', $friend['FriendRequest']['id']), array('update' => 'friend_<?php echo $friend['FriendRequest']['id'] ?>')
); 
?>




I'm getting an error no matter what I do by placing in echo '(',  ')' , <?php echo ($friend['FriendRequest']['id']) ?>    ....
Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/xachkaa/hamayk.com/html/app/views/friends/requests.ctp on line 83

can anyone help please,...? 

thanks in advance 
chris

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 



--
Chetan Varshney
Ektanjali Softwares Pvt Ltd

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

No comments: