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 9181135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:12:53+00:00 2026-06-17T18:12:53+00:00

To create an input field corresponding to a model one can use this: cakephp

  • 0

To create an input field corresponding to a model one can use this:

cakephp $this->Form->input('Model.field');

To rename it, one can use

cakephp $this->Form->input('Model.field', array('label' => __('new field name')));

But consider I have a huge application and I don’t want to rename each field over and over again. This question is asked a lot of times and the always answer this beginner question with the solution I gave. But there has to be a more elegant way in CakePHP … I would guess that one can build a workaround with Translate Behavior. Is this the best way to go?

  • 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-06-17T18:12:54+00:00Added an answer on June 17, 2026 at 6:12 pm

    The way you indicate is the way it is done in CakePHP. The field name MUST correspond to the name in the model. If you do not like the name, you can always change the name in the model to represent what you want it to show on the form. Otherwise, you must use the label field as indicated.

    I guess there could be another way. You could override the form helper to do the translation for you. But then you will be managing a large array of form names to dynamically insert the label based on the name. This seems like a lot of extra work just to change a label though.

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

Sidebar

Related Questions

This is frustrating, I want to simply create new input field inside div on
What is the simplest way to dynamically create a hidden input form field using
I am using form_for to create a form that has 1 input field and
I'm new to Java. I created this code in order to check input field
I would like to create an input field where you can click/touch into and
I would like to create a form which has multiple input fields corresponding to
I want to create an input field like Android Ice Cream Sandwich's one in
i create two input text fields , one for title and another for permanent
Basically, I have a user input field where a user can enter a number.
How can I make the input field wider than the default in Twitter's Bootstrap?

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.