Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3425308
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:34:42+00:00 2026-05-18T06:34:42+00:00

I have site with single Post which has comment form. How could I receive

  • 0

I have site with single Post which has comment form. How could I receive id of post in my add() method of Comment controller?
Thx!.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T06:34:42+00:00Added an answer on May 18, 2026 at 6:34 am

    If the models are binded correctly (Post hasMany Comment, Comment belongsTo Post) you can do it like that:

    /views/comments/add.ctp or /views/posts/view.php:

    <?php echo $this->Form->input('post_id', array('type' => 'hidden', 'value' => $post['Post']['id'])); ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My site currently has a single, large, static image as its background image. I
I have a custom made web-site in Python/MySQL with custom user/session tables and users
We have an a PHP application that we are converting to MVC. The goal
I need some ideas how to handle the database structure for a site i'm
Background I have a secured folder containing secret report files (in pdf format). Each
I have a Django based CMS that uses Django's sites framework and Nginx/Apache/mod_wsgi virtual
Well, it may actually be a simple case but I'm having a tough time
I'm pulling some data from a forum and use it to display comments on
Reaching out to the community here for a best practice/best implementation question. I am
We're using ASP.NET and IIS 6.0. I realise that the definitions of applications, websites

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.