I have a POST model and a COMMENT model. In my Comments element i am retrieving POST_ID from URL which is working fine.
Now i am calling POST and COMMENT element on homepage but when i add comment it is not taking the id from URL as the URL is now /home rather than /post/view/id.
How can i sort this out?
This is how i am retrieving Id from URL
$id = $this->request['pass'][0];
echo $this->form->input('note_id', array('type'=>'hidden', 'value'=>$id));
When you are displaying the post and comment you probably have arrays like
$posts['Post']and$comments['Comment']so for getting post_id you can probably use$posts['Post']['id']the id you can set then