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

  • Home
  • SEARCH
  • 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 5840715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:47:20+00:00 2026-05-22T11:47:20+00:00

folks. I’m starting with CakePHP and after reviewing this tutorial ( http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application ) and

  • 0

folks.
I’m starting with CakePHP and after reviewing this tutorial (
http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application
) and also after having used the “cake bake” command to generate my
models,
controllers and views , everything is fine, but when I visit the
Post’s add view (views \ posts
\ add.php), I find that instead of showing a input text for the
username, it shows a select with all the usernames.

this is the line in the Post’s add view that show the select.

echo $this->Form->input('user_id');

PostsController :

function add() {
// Some other code  
    $users = $this->Post->User->find('list');
    $this->set(compact('users'));
}

Although I know how to display only the username of the currently
logged-in user, I don’t know how to control the content to show in
$this->Form->input() because if I use a variable that is not part of
the “Post” model , it’s shown , but as the label for the input.

Have you any idea how to solve this??

P.S. I’ve been trying to find this information on the cookbook , but I haven’t been able to find anything specific to my situation 🙁

  • 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-22T11:47:21+00:00Added an answer on May 22, 2026 at 11:47 am

    If you want to add a string in as the value of the input, try this :

    echo $form->input('my label text',array('value'=>'the value string','type'=>'hidden')); 
    

    That would make the input hidden, and set the value.
    Or remove the type=>hidden and it will have a value, you can also add things like disabled and such in there, or to modify the div it creates, use div'=>array() and put your div options in that array… hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

folks! I have project in cc.net and this project nay start by 3 ways
Folks I have a sealed class as follows. I want to extend this sealed
Folks, why jQuery hover does not work? Here is the link - http://layot.prestatrend.com/ Thanks
Folks, I am creating an installer project in Visual Studio. This is done using
Folks, I have a HTML file which contains a button called Email this content
Folks, Apologies if this has been covered in another thread, but I have searched
Folks, I have an hourly temperature data like this Lines <- Date,Outdoor,Indoor 01/01 01:00:00,24.5,21.3
Folks, This is easy, but I cannot seem to get this right, any help
Folks, This seems like a basic program and I cannot understand what is going
Folks, I am trying to display EXT JS with Row Expander plugin in a

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.